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

Fix auto update not working for AppImage (#4256)

This commit is contained in:
Sebastian Malton 2021-11-04 12:11:08 -04:00 committed by GitHub
parent 526b7c46be
commit 43845ed145
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -21,7 +21,7 @@
import { autoUpdater, UpdateInfo } from "electron-updater";
import logger from "./logger";
import { isDevelopment, isMac, isPublishConfigured, isTestEnv } from "../common/vars";
import { isDevelopment, isLinux, isMac, isPublishConfigured, isTestEnv } from "../common/vars";
import { delay } from "../common/utils";
import { areArgsUpdateAvailableToBackchannel, AutoUpdateLogPrefix, broadcastMessage, onceCorrect, UpdateAvailableChannel, UpdateAvailableToBackchannel } from "../common/ipc";
import { once } from "lodash";
@ -48,6 +48,14 @@ function handleAutoUpdateBackChannel(event: Electron.IpcMainEvent, ...[arg]: Upd
* download it from itself via electron.
*/
electronAutoUpdater.checkForUpdates();
} else if (isLinux) {
/**
* This is a necessary workaround until electron-updater is fixed.
* The problem is that because linux updating is not implemented at
* all via electron. Electron's autoUpdater.quitAndInstall() is never
* called.
*/
electronAutoUpdater.emit("before-quit-for-update");
}
autoUpdater.quitAndInstall(true, true);
});

View File

@ -286,7 +286,10 @@ app.on("activate", (event, hasVisibleWindows) => {
*/
let blockQuit = !isIntegrationTesting;
autoUpdater.on("before-quit-for-update", () => blockQuit = false);
autoUpdater.on("before-quit-for-update", () => {
logger.debug("Unblocking quit for update");
blockQuit = false;
});
app.on("will-quit", (event) => {
// This is called when the close button of the main window is clicked