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:
parent
91edfc7206
commit
c0cfd3e42d
@ -8,6 +8,7 @@ import type { UpdateInfo } from "electron-updater";
|
|||||||
export const UpdateAvailableChannel = "update-available";
|
export const UpdateAvailableChannel = "update-available";
|
||||||
export const AutoUpdateChecking = "auto-update:checking";
|
export const AutoUpdateChecking = "auto-update:checking";
|
||||||
export const AutoUpdateNoUpdateAvailable = "auto-update:no-update";
|
export const AutoUpdateNoUpdateAvailable = "auto-update:no-update";
|
||||||
|
export const AutoUpdateQuitAndInstalledChannel = "auto-update:quit-and-install";
|
||||||
export const AutoUpdateLogPrefix = "[UPDATE-CHECKER]";
|
export const AutoUpdateLogPrefix = "[UPDATE-CHECKER]";
|
||||||
|
|
||||||
export type UpdateAvailableFromMain = [backChannel: string, updateInfo: UpdateInfo];
|
export type UpdateAvailableFromMain = [backChannel: string, updateInfo: UpdateInfo];
|
||||||
|
|||||||
@ -25,7 +25,7 @@ function handleAutoUpdateBackChannel(event: Electron.IpcMainEvent, ...[arg]: Upd
|
|||||||
if (arg.doUpdate) {
|
if (arg.doUpdate) {
|
||||||
if (arg.now) {
|
if (arg.now) {
|
||||||
logger.info(`${AutoUpdateLogPrefix}: User chose to update now`);
|
logger.info(`${AutoUpdateLogPrefix}: User chose to update now`);
|
||||||
autoUpdater.quitAndInstall(true, true);
|
quitAndInstallUpdate();
|
||||||
} else {
|
} else {
|
||||||
logger.info(`${AutoUpdateLogPrefix}: User chose to update on quit`);
|
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);
|
logger.error(`${AutoUpdateLogPrefix}: failed with an error`, error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function quitAndInstallUpdate() {
|
||||||
|
autoUpdater.quitAndInstall(true, true);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user