Guard update install while app is quitting
- Prevent update install from running when shutdown is already in progress - Ignore install IPC calls once `isQuitting` is set to avoid duplicate install attempts
This commit is contained in:
1 parent
392d63231c
commit
865d7bd684
1 file changed
+2
-1
@@ -641,7 +641,7 @@ async function downloadAvailableUpdate(): Promise<void> {
|
||||
}
|
||||
|
||||
function installDownloadedUpdate(): void {
|
||||
if (!updaterConfigured || updateState.status !== "downloaded") return;
|
||||
if (isQuitting || !updaterConfigured || updateState.status !== "downloaded") return;
|
||||
|
||||
isQuitting = true;
|
||||
clearUpdatePollTimer();
|
||||
@@ -1030,6 +1030,7 @@ function registerIpcHandlers(): void {
|
||||
|
||||
ipcMain.removeHandler(UPDATE_INSTALL_CHANNEL);
|
||||
ipcMain.handle(UPDATE_INSTALL_CHANNEL, async () => {
|
||||
if (isQuitting) return;
|
||||
installDownloadedUpdate();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user