mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Change update default to update on quit (#5298)
This commit is contained in:
parent
432fc534c6
commit
321fc735dd
@ -28,10 +28,9 @@ function handleAutoUpdateBackChannel(event: Electron.IpcMainEvent, ...[arg]: Upd
|
|||||||
autoUpdater.quitAndInstall(true, true);
|
autoUpdater.quitAndInstall(true, true);
|
||||||
} else {
|
} else {
|
||||||
logger.info(`${AutoUpdateLogPrefix}: User chose to update on quit`);
|
logger.info(`${AutoUpdateLogPrefix}: User chose to update on quit`);
|
||||||
autoUpdater.autoInstallOnAppQuit = true;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.info(`${AutoUpdateLogPrefix}: User chose not to update`);
|
logger.info(`${AutoUpdateLogPrefix}: User chose not to update, will update on quit anyway`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,9 +43,9 @@ autoUpdater.logger = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* starts the automatic update checking
|
* starts the automatic update checking
|
||||||
* @param interval milliseconds between interval to check on, defaults to 24h
|
* @param interval milliseconds between interval to check on, defaults to 2h
|
||||||
*/
|
*/
|
||||||
export const startUpdateChecking = once(function (interval = 1000 * 60 * 60 * 24): void {
|
export const startUpdateChecking = once(function (interval = 1000 * 60 * 60 * 2): void {
|
||||||
if (!isAutoUpdateEnabled() || isTestEnv) {
|
if (!isAutoUpdateEnabled() || isTestEnv) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -54,26 +53,17 @@ export const startUpdateChecking = once(function (interval = 1000 * 60 * 60 * 24
|
|||||||
const userStore = UserStore.getInstance();
|
const userStore = UserStore.getInstance();
|
||||||
|
|
||||||
autoUpdater.autoDownload = false;
|
autoUpdater.autoDownload = false;
|
||||||
autoUpdater.autoInstallOnAppQuit = false;
|
autoUpdater.autoInstallOnAppQuit = true;
|
||||||
autoUpdater.channel = userStore.updateChannel;
|
autoUpdater.channel = userStore.updateChannel;
|
||||||
autoUpdater.allowDowngrade = userStore.isAllowedToDowngrade;
|
autoUpdater.allowDowngrade = userStore.isAllowedToDowngrade;
|
||||||
|
|
||||||
autoUpdater
|
autoUpdater
|
||||||
.on("update-available", (info: UpdateInfo) => {
|
.on("update-available", (info: UpdateInfo) => {
|
||||||
if (autoUpdater.autoInstallOnAppQuit) {
|
|
||||||
// a previous auto-update loop was completed with YES+LATER, check if same version
|
|
||||||
if (installVersion === info.version) {
|
if (installVersion === info.version) {
|
||||||
// same version, don't broadcast
|
// same version, don't broadcast
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This should be always set to false here because it is the reasonable
|
|
||||||
* default. Namely, if a don't auto update to a version that the user
|
|
||||||
* didn't ask for.
|
|
||||||
*/
|
|
||||||
autoUpdater.autoInstallOnAppQuit = false;
|
|
||||||
installVersion = info.version;
|
installVersion = info.version;
|
||||||
|
|
||||||
autoUpdater.downloadUpdate()
|
autoUpdater.downloadUpdate()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user