Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 3bd4a67

Browse files
getneilneil molina
andauthored
#586 suggest alternative when auto update not working (#592)
* #586 suggest alternative when auto update not working * add suggested strategy when calling quitAndInstall --------- Co-authored-by: neil molina <neil@neils-MacBook-Pro.local>
1 parent 67edf99 commit 3bd4a67

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

modules/desktop/electron/libs/ipc.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ export default function initializeHandlers({ notifyMainWindow }: HandlerOptions)
9393
try {
9494
log.info("relaunching app");
9595
const autoUpdater = getUpdater();
96-
await autoUpdater.quitAndInstall();
96+
setImmediate(() => {
97+
autoUpdater.quitAndInstall();
98+
});
9799
} catch (error) {
98100
log.error(error);
99101
}

modules/desktop/src/components/settings-menu/update-button.svelte

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
import { appUpdateStore } from "$libs/stores";
55
66
const { updateStatus } = appUpdateStore;
7+
8+
let updateClickCount = 0;
9+
const onRelaunch = async () => {
10+
if (updateClickCount < 1) {
11+
await relaunch();
12+
}
13+
updateClickCount++;
14+
};
715
</script>
816

917
{#if $updateStatus.status === "up-to-date"}
@@ -23,7 +31,7 @@
2331
{:else if $updateStatus.status === "ready"}
2432
<button
2533
class="flex h-7 w-full items-center justify-between p-1 text-left outline-1 outline-gray hover:bg-gray hover:bg-opacity-25 hover:outline"
26-
on:click={relaunch}
34+
on:click={onRelaunch}
2735
>
2836
<div class="flex items-center">
2937
<div class="circle-badge mr-2">1</div>
@@ -35,6 +43,10 @@
3543
</button>
3644
{/if}
3745

46+
{#if $updateStatus.status === "ready" && updateClickCount >= 3}
47+
<p class="p-1 text-xs text-primary">Force quit and relaunch the app, please.</p>
48+
{/if}
49+
3850
<style>
3951
.circle-badge {
4052
display: flex;

0 commit comments

Comments
 (0)