mirror of
https://github.com/AmintaCCCP/GithubStarsManager.git
synced 2025-11-25 02:34:54 +08:00
Merge pull request #14 from CrisChr/bugfix/#10
bugfix[#10]:修复ai分析过程中,切换Header导致分析进度变为0的问题
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user