mirror of
https://github.com/upscayl/upscayl.git
synced 2025-01-19 09:27:27 +01:00
Refactor auto-update dialog handling #589
This commit is contained in:
parent
8291ff1b2e
commit
305822eb5c
@ -12,18 +12,19 @@ const autoUpdate = (event: UpdateDownloadedEvent) => {
|
|||||||
detail:
|
detail:
|
||||||
"A new version has been downloaded. Restart the application to apply the updates.",
|
"A new version has been downloaded. Restart the application to apply the updates.",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const dialogResponse = dialog.showMessageBoxSync(dialogOpts);
|
||||||
|
|
||||||
logit("✅ Update Downloaded");
|
logit("✅ Update Downloaded");
|
||||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
if (dialogResponse === 0) {
|
||||||
if (returnValue.response === 0) {
|
autoUpdater.quitAndInstall();
|
||||||
autoUpdater.quitAndInstall();
|
} else if (dialogResponse === 2) {
|
||||||
} else if (returnValue.response === 2) {
|
shell.openExternal(
|
||||||
shell.openExternal(
|
"https://github.com/upscayl/upscayl/releases/tag/v" + event.version
|
||||||
"https://github.com/upscayl/upscayl/releases/tag/v" + event.version
|
);
|
||||||
);
|
} else {
|
||||||
} else {
|
logit("🚫 Update Installation Cancelled");
|
||||||
logit("🚫 Update Installation Cancelled");
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default autoUpdate;
|
export default autoUpdate;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user