mirror of
https://github.com/upscayl/upscayl.git
synced 2025-01-19 01:24:09 +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:
|
||||
"A new version has been downloaded. Restart the application to apply the updates.",
|
||||
};
|
||||
|
||||
const dialogResponse = dialog.showMessageBoxSync(dialogOpts);
|
||||
|
||||
logit("✅ Update Downloaded");
|
||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
||||
if (returnValue.response === 0) {
|
||||
autoUpdater.quitAndInstall();
|
||||
} else if (returnValue.response === 2) {
|
||||
shell.openExternal(
|
||||
"https://github.com/upscayl/upscayl/releases/tag/v" + event.version
|
||||
);
|
||||
} else {
|
||||
logit("🚫 Update Installation Cancelled");
|
||||
}
|
||||
});
|
||||
if (dialogResponse === 0) {
|
||||
autoUpdater.quitAndInstall();
|
||||
} else if (dialogResponse === 2) {
|
||||
shell.openExternal(
|
||||
"https://github.com/upscayl/upscayl/releases/tag/v" + event.version
|
||||
);
|
||||
} else {
|
||||
logit("🚫 Update Installation Cancelled");
|
||||
}
|
||||
};
|
||||
|
||||
export default autoUpdate;
|
||||
|
Loading…
x
Reference in New Issue
Block a user