mirror of
https://github.com/ivabus/gui
synced 2025-04-23 14:07:14 +03:00
* #586 suggest alternative when auto update not working * add suggested strategy when calling quitAndInstall --------- Co-authored-by: neil molina <neil@neils-MacBook-Pro.local>
This commit is contained in:
parent
67edf9971b
commit
3bd4a67238
2 changed files with 16 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,14 @@
|
|||
import { appUpdateStore } from "$libs/stores";
|
||||
|
||||
const { updateStatus } = appUpdateStore;
|
||||
|
||||
let updateClickCount = 0;
|
||||
const onRelaunch = async () => {
|
||||
if (updateClickCount < 1) {
|
||||
await relaunch();
|
||||
}
|
||||
updateClickCount++;
|
||||
};
|
||||
</script>
|
||||
|
||||
{#if $updateStatus.status === "up-to-date"}
|
||||
|
@ -23,7 +31,7 @@
|
|||
{:else if $updateStatus.status === "ready"}
|
||||
<button
|
||||
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"
|
||||
on:click={relaunch}
|
||||
on:click={onRelaunch}
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<div class="circle-badge mr-2">1</div>
|
||||
|
@ -35,6 +43,10 @@
|
|||
</button>
|
||||
{/if}
|
||||
|
||||
{#if $updateStatus.status === "ready" && updateClickCount >= 3}
|
||||
<p class="p-1 text-xs text-primary">Force quit and relaunch the app, please.</p>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.circle-badge {
|
||||
display: flex;
|
||||
|
|
Loading…
Reference in a new issue