This commit is contained in:
CrisChr
2025-08-21 14:17:18 +08:00
parent 3272ff2d66
commit 83bf2d9334
3 changed files with 16 additions and 2 deletions

View File

@@ -25,11 +25,12 @@ export const RepositoryList: React.FC<RepositoryListProps> = ({
updateRepository,
language,
customCategories,
analysisProgress,
setAnalysisProgress
} = useAppStore();
const [showAISummary, setShowAISummary] = useState(true);
const [showDropdown, setShowDropdown] = useState(false);
const [analysisProgress, setAnalysisProgress] = useState({ current: 0, total: 0 });
const [isPaused, setIsPaused] = useState(false);
const [searchTime, setSearchTime] = useState<number | undefined>(undefined);

View File

@@ -1,6 +1,6 @@
import { create } from 'zustand';
import { persist } from 'zustand/middleware';
import { AppState, Repository, Release, AIConfig, WebDAVConfig, SearchFilters, GitHubUser, Category, AssetFilter, UpdateNotification } from '../types';
import { AppState, Repository, Release, AIConfig, WebDAVConfig, SearchFilters, GitHubUser, Category, AssetFilter, UpdateNotification, AnalysisProgress } from '../types';
interface AppActions {
// Auth actions
@@ -56,6 +56,9 @@ interface AppActions {
// Update actions
setUpdateNotification: (notification: UpdateNotification | null) => void;
dismissUpdateNotification: () => void;
// Update Analysis Progress
setAnalysisProgress: (newProgress: AnalysisProgress) => void;
}
const initialSearchFilters: SearchFilters = {
@@ -182,6 +185,7 @@ export const useAppStore = create<AppState & AppActions>()(
currentView: 'repositories',
language: 'zh',
updateNotification: null,
analysisProgress: { current: 0, total: 0 },
// Auth actions
setUser: (user) => {
@@ -316,6 +320,7 @@ export const useAppStore = create<AppState & AppActions>()(
// Update actions
setUpdateNotification: (notification) => set({ updateNotification: notification }),
dismissUpdateNotification: () => set({ updateNotification: null }),
setAnalysisProgress: (newProgress) => set({ analysisProgress: newProgress })
}),
{
name: 'github-stars-manager',

View File

@@ -157,6 +157,9 @@ export interface AppState {
// Update
updateNotification: UpdateNotification | null;
// Analysis Progress
analysisProgress: AnalysisProgress
}
export interface UpdateNotification {
@@ -165,4 +168,9 @@ export interface UpdateNotification {
changelog: string[];
downloadUrl: string;
dismissed: boolean;
}
export interface AnalysisProgress {
current: number;
total: number;
}