feat: 一些优化

This commit is contained in:
cc
2026-01-30 23:47:46 +08:00
parent 7225358b91
commit e4ed7faca9
20 changed files with 222 additions and 725 deletions

View File

@@ -33,6 +33,10 @@ export interface AppState {
setShowUpdateDialog: (show: boolean) => void
setUpdateError: (error: string | null) => void
// 锁定状态
isLocked: boolean
setLocked: (locked: boolean) => void
reset: () => void
}
@@ -42,6 +46,7 @@ export const useAppStore = create<AppState>((set) => ({
myWxid: null,
isLoading: false,
loadingText: '',
isLocked: false,
// 更新状态初始化
updateInfo: null,
@@ -62,6 +67,8 @@ export const useAppStore = create<AppState>((set) => ({
loadingText: text ?? ''
}),
setLocked: (locked) => set({ isLocked: locked }),
setUpdateInfo: (info) => set({ updateInfo: info, updateError: null }),
setIsDownloading: (isDownloading) => set({ isDownloading: isDownloading }),
setDownloadProgress: (progress) => set({ downloadProgress: progress }),
@@ -74,6 +81,7 @@ export const useAppStore = create<AppState>((set) => ({
myWxid: null,
isLoading: false,
loadingText: '',
isLocked: false,
updateInfo: null,
isDownloading: false,
downloadProgress: { percent: 0 },