1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00

#1fep8zf: Updater logic fixes

This commit is contained in:
Andrew Simachev 2021-09-29 09:23:30 +03:00
parent dd03607bea
commit 43303a5d9f
2 changed files with 33 additions and 3 deletions

View file

@ -21,7 +21,7 @@ const envPath = path.join(__dirname, 'electron', 'env.json');
const systemVersion = process.getSystemVersion();
const protocol = 'anytype';
const TIMEOUT_UPDATE = 600 * 1000;
const TIMEOUT_UPDATE = 30 * 1000; //600 * 1000;
const MIN_WIDTH = 752;
const MIN_HEIGHT = 480;
const KEYTAR_SERVICE = 'Anytype';
@ -307,6 +307,10 @@ function createWindow () {
autoUpdater.downloadUpdate();
});
ipcMain.on('updateConfirm', (e) => {
exit(true);
});
ipcMain.on('updateCancel', (e) => {
isUpdating = false;
clearTimeout(timeoutUpdate);
@ -696,7 +700,12 @@ function autoUpdaterInit () {
isUpdating = false;
Util.log('info', 'Update downloaded: ' + JSON.stringify(info, null, 3));
send('update-downloaded');
exit(true);
if (!autoUpdate) {
exit(true);
} else {
send('update-confirm');
};
});
};