move Update "haveBeenUpdated" when update is available

This commit is contained in:
Shidorien
2023-11-24 03:06:22 +01:00
parent 385c403bee
commit 00bf26081b
2 changed files with 4 additions and 2 deletions
+4 -1
View File
@@ -13,7 +13,10 @@ ipcMain.on("download-update", async (event, request: IpcRequest<void>) => {
updaterService
.downloadUpdate()
.then(res => utilsService.ipcSend(request.responceChannel, { success: res }))
.then(res => {
utilsService.ipcSend(request.responceChannel, { success: res });
updaterService.setHaveBeenUpdated(true);
})
.catch(() => utilsService.ipcSend(request.responceChannel, { success: false }));
});
@@ -39,7 +39,6 @@ export class AutoUpdaterService {
if (!info?.updateInfo) {
return false;
}
this.setHaveBeenUpdated(true);
return gt(info.updateInfo.version, autoUpdater.currentVersion.version);
})();
resolve(needUpdate);