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 {
|
try {
|
||||||
log.info("relaunching app");
|
log.info("relaunching app");
|
||||||
const autoUpdater = getUpdater();
|
const autoUpdater = getUpdater();
|
||||||
await autoUpdater.quitAndInstall();
|
setImmediate(() => {
|
||||||
|
autoUpdater.quitAndInstall();
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(error);
|
log.error(error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,14 @@
|
||||||
import { appUpdateStore } from "$libs/stores";
|
import { appUpdateStore } from "$libs/stores";
|
||||||
|
|
||||||
const { updateStatus } = appUpdateStore;
|
const { updateStatus } = appUpdateStore;
|
||||||
|
|
||||||
|
let updateClickCount = 0;
|
||||||
|
const onRelaunch = async () => {
|
||||||
|
if (updateClickCount < 1) {
|
||||||
|
await relaunch();
|
||||||
|
}
|
||||||
|
updateClickCount++;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $updateStatus.status === "up-to-date"}
|
{#if $updateStatus.status === "up-to-date"}
|
||||||
|
@ -23,7 +31,7 @@
|
||||||
{:else if $updateStatus.status === "ready"}
|
{:else if $updateStatus.status === "ready"}
|
||||||
<button
|
<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"
|
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="flex items-center">
|
||||||
<div class="circle-badge mr-2">1</div>
|
<div class="circle-badge mr-2">1</div>
|
||||||
|
@ -35,6 +43,10 @@
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
{/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>
|
<style>
|
||||||
.circle-badge {
|
.circle-badge {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
Loading…
Reference in a new issue