1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Move quitAndInstall() to separate function

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-05-30 13:04:18 +03:00
parent 91edfc7206
commit c0cfd3e42d
2 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import type { UpdateInfo } from "electron-updater";
export const UpdateAvailableChannel = "update-available";
export const AutoUpdateChecking = "auto-update:checking";
export const AutoUpdateNoUpdateAvailable = "auto-update:no-update";
export const AutoUpdateQuitAndInstalledChannel = "auto-update:quit-and-install";
export const AutoUpdateLogPrefix = "[UPDATE-CHECKER]";
export type UpdateAvailableFromMain = [backChannel: string, updateInfo: UpdateInfo];

View File

@ -25,7 +25,7 @@ function handleAutoUpdateBackChannel(event: Electron.IpcMainEvent, ...[arg]: Upd
if (arg.doUpdate) {
if (arg.now) {
logger.info(`${AutoUpdateLogPrefix}: User chose to update now`);
autoUpdater.quitAndInstall(true, true);
quitAndInstallUpdate();
} else {
logger.info(`${AutoUpdateLogPrefix}: User chose to update on quit`);
}
@ -131,3 +131,7 @@ export async function checkForUpdates(): Promise<void> {
logger.error(`${AutoUpdateLogPrefix}: failed with an error`, error);
}
}
export function quitAndInstallUpdate() {
autoUpdater.quitAndInstall(true, true);
}