From 83bf2d933419ec35d84a43f90c5681dde2d344b7 Mon Sep 17 00:00:00 2001 From: CrisChr Date: Thu, 21 Aug 2025 14:17:18 +0800 Subject: [PATCH] bugfix[#10] --- src/components/RepositoryList.tsx | 3 ++- src/store/useAppStore.ts | 7 ++++++- src/types/index.ts | 8 ++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/RepositoryList.tsx b/src/components/RepositoryList.tsx index 36d84d7..c02027c 100644 --- a/src/components/RepositoryList.tsx +++ b/src/components/RepositoryList.tsx @@ -25,11 +25,12 @@ export const RepositoryList: React.FC = ({ 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(undefined); diff --git a/src/store/useAppStore.ts b/src/store/useAppStore.ts index 4103091..7daeae1 100644 --- a/src/store/useAppStore.ts +++ b/src/store/useAppStore.ts @@ -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()( currentView: 'repositories', language: 'zh', updateNotification: null, + analysisProgress: { current: 0, total: 0 }, // Auth actions setUser: (user) => { @@ -316,6 +320,7 @@ export const useAppStore = create()( // Update actions setUpdateNotification: (notification) => set({ updateNotification: notification }), dismissUpdateNotification: () => set({ updateNotification: null }), + setAnalysisProgress: (newProgress) => set({ analysisProgress: newProgress }) }), { name: 'github-stars-manager', diff --git a/src/types/index.ts b/src/types/index.ts index e7b0616..35d7e32 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -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; } \ No newline at end of file