Skip to content
This repository was archived by the owner on Apr 22, 2022. It is now read-only.

Commit c725d19

Browse files
committed
Fixed bug on macOS when restart app on new version
The app stays open and this confuse the user.
1 parent c61e3b7 commit c725d19

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

electron/updater.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const {app, ipcMain} = require('electron');
1+
const { app, ipcMain } = require('electron');
22
const { autoUpdater } = require("electron-updater");
33
const path = require('path');
44

@@ -12,7 +12,11 @@ const initialize = (window) => {
1212
const send = webContents.send.bind(window.webContents);
1313
autoUpdater.on('checking-for-update', (event) => send('autoUpdater:checking-for-update'));
1414
autoUpdater.on('update-downloaded', (...args) => send('autoUpdater:update-downloaded', ...args));
15-
ipcMain.on('autoUpdater:quit-and-install', (event) => autoUpdater.quitAndInstall());
15+
ipcMain.on('autoUpdater:quit-and-install', (event) => {
16+
app.removeAllListeners('window-all-closed');
17+
BrowserWindow.getAllWindows().forEach((browserWindow) => browserWindow.removeAllListeners('close'));
18+
autoUpdater.quitAndInstall()
19+
});
1620
ipcMain.on('autoUpdater:check-for-updates', (event) => autoUpdater.checkForUpdates());
1721
};
1822

0 commit comments

Comments
 (0)