Skip to content

Commit bb1654e

Browse files
authored
Merge pull request #646 from gr8kingg/mac-shutdown
Allow shutdown on mac while app is running
2 parents c45866d + 78d3633 commit bb1654e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This is the electron startup script
2-
const { app, BrowserWindow, Tray, Menu, dialog, ipcMain } = require('electron');
2+
const { app, BrowserWindow, Tray, Menu, dialog, ipcMain, powerMonitor } = require('electron');
33
const { autoUpdater } = require("electron-updater");
44
const { nativeImage } = require('electron/common');
55
const path = require("path");
@@ -209,6 +209,11 @@ function checkForUpdates() {
209209
});
210210
}
211211

212+
powerMonitor.on('shutdown', () => {
213+
app.isQuiting = true;
214+
app.quit();
215+
});
216+
212217

213218
if (!gotTheLock) {
214219
app.quit();

0 commit comments

Comments
 (0)