mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix auto update not working for AppImage
- Emulate electron.autoUpdater's 'before-quit-for-update' event flow Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
a93108c103
commit
f03eaa72b5
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
import { autoUpdater, UpdateInfo } from "electron-updater";
|
import { autoUpdater, UpdateInfo } from "electron-updater";
|
||||||
import logger from "./logger";
|
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 { delay } from "../common/utils";
|
||||||
import { areArgsUpdateAvailableToBackchannel, AutoUpdateLogPrefix, broadcastMessage, onceCorrect, UpdateAvailableChannel, UpdateAvailableToBackchannel } from "../common/ipc";
|
import { areArgsUpdateAvailableToBackchannel, AutoUpdateLogPrefix, broadcastMessage, onceCorrect, UpdateAvailableChannel, UpdateAvailableToBackchannel } from "../common/ipc";
|
||||||
import { once } from "lodash";
|
import { once } from "lodash";
|
||||||
@ -48,6 +48,8 @@ function handleAutoUpdateBackChannel(event: Electron.IpcMainEvent, ...[arg]: Upd
|
|||||||
* download it from itself via electron.
|
* download it from itself via electron.
|
||||||
*/
|
*/
|
||||||
electronAutoUpdater.checkForUpdates();
|
electronAutoUpdater.checkForUpdates();
|
||||||
|
} else if (isLinux) {
|
||||||
|
electronAutoUpdater.emit("before-quit-for-update");
|
||||||
}
|
}
|
||||||
autoUpdater.quitAndInstall(true, true);
|
autoUpdater.quitAndInstall(true, true);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -286,7 +286,10 @@ app.on("activate", (event, hasVisibleWindows) => {
|
|||||||
*/
|
*/
|
||||||
let blockQuit = !isIntegrationTesting;
|
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) => {
|
app.on("will-quit", (event) => {
|
||||||
// This is called when the close button of the main window is clicked
|
// This is called when the close button of the main window is clicked
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user