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:
Julius Marminge authored and Julius Marminge committed 2026-03-03 22:31:45 -08:00
1 parent 392d63231c
commit 865d7bd684
1 file changed
+2 -1
+2 -1
View File
@@ -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();
});
}