fix(下载队列): 避免更新任务覆盖安装状态

This commit is contained in:
2026-04-13 12:57:24 +08:00
parent 763af5c37e
commit f83f8f6d80
9 changed files with 184 additions and 32 deletions
+7 -2
View File
@@ -33,6 +33,11 @@ type UpdateCenterSnapshot = {
hasRunningTasks: boolean;
};
type UpdateCenterStartTask = {
taskKey: string;
id: number;
};
type IpcRendererFacade = {
on: typeof ipcRenderer.on;
off: typeof ipcRenderer.off;
@@ -98,8 +103,8 @@ contextBridge.exposeInMainWorld("updateCenter", {
packageName: string;
newVersion: string;
}): Promise<void> => ipcRenderer.invoke("update-center-unignore", payload),
start: (taskKeys: string[]): Promise<void> =>
ipcRenderer.invoke("update-center-start", taskKeys),
start: (tasks: UpdateCenterStartTask[]): Promise<void> =>
ipcRenderer.invoke("update-center-start", tasks),
cancel: (taskKey: string): Promise<void> =>
ipcRenderer.invoke("update-center-cancel", taskKey),
getState: (): Promise<UpdateCenterSnapshot> =>