add hard restart for updates on *nix

reincarnates app.Restart() removed in
bbb0568cc4 as app.HardRestart().
This commit is contained in:
Harvey Tindall
2021-05-03 20:08:23 +01:00
parent b2b5083102
commit 0e21942cd6
6 changed files with 64 additions and 3 deletions
+9 -2
View File
@@ -107,13 +107,20 @@ export class Updater implements updater {
_post("/config/update", null, (req: XMLHttpRequest) => {
if (req.readyState == 4) {
toggleLoader(update);
if (req.status != 200) {
const success = req.response["success"] as Boolean;
if (req.status == 500 && success) {
window.notifications.customSuccess("applyUpdate", window.lang.notif("updateAppliedRefresh"));
} else if (req.status != 200) {
window.notifications.customError("applyUpdateError", window.lang.notif("errorApplyUpdate"));
} else {
window.notifications.customSuccess("applyUpdate", window.lang.notif("updateApplied"));
window.notifications.customSuccess("applyUpdate", window.lang.notif("updateAppliedRefresh"));
}
window.modals.updateInfo.close();
}
}, true, (req: XMLHttpRequest) => {
if (req.status == 0) {
window.notifications.customSuccess("applyUpdate", window.lang.notif("updateAppliedRefresh"));
}
});
};
this.checkForUpdates(() => {