diff --git a/modules/desktop/electron/libs/ipc.ts b/modules/desktop/electron/libs/ipc.ts index 56457aa..4e166a2 100644 --- a/modules/desktop/electron/libs/ipc.ts +++ b/modules/desktop/electron/libs/ipc.ts @@ -93,7 +93,9 @@ export default function initializeHandlers({ notifyMainWindow }: HandlerOptions) try { log.info("relaunching app"); const autoUpdater = getUpdater(); - await autoUpdater.quitAndInstall(); + setImmediate(() => { + autoUpdater.quitAndInstall(); + }); } catch (error) { log.error(error); } diff --git a/modules/desktop/src/components/settings-menu/update-button.svelte b/modules/desktop/src/components/settings-menu/update-button.svelte index 4faba76..ff80b14 100644 --- a/modules/desktop/src/components/settings-menu/update-button.svelte +++ b/modules/desktop/src/components/settings-menu/update-button.svelte @@ -4,6 +4,14 @@ import { appUpdateStore } from "$libs/stores"; const { updateStatus } = appUpdateStore; + + let updateClickCount = 0; + const onRelaunch = async () => { + if (updateClickCount < 1) { + await relaunch(); + } + updateClickCount++; + }; {#if $updateStatus.status === "up-to-date"} @@ -23,7 +31,7 @@ {:else if $updateStatus.status === "ready"} {/if} +{#if $updateStatus.status === "ready" && updateClickCount >= 3} +

Force quit and relaunch the app, please.

+{/if} +