diff --git a/main.js b/main.js index 98544c4..a10a1ad 100644 --- a/main.js +++ b/main.js @@ -29,7 +29,7 @@ let win; * - Linux: `app.getPath('exe')` * - MacOS: `path.resolve(app.getPath('exe'), "../../../../")` * 3. `__dirname` (Development) -*/ + */ function loadConfig() { const locations = [ '/assets/presentation', @@ -81,7 +81,6 @@ async function createWindow() { }); nativeTheme.themeSource = 'dark'; - Menu.setApplicationMenu(null); // register event callbacks win.on("closed", function () { win = null; }); @@ -124,7 +123,6 @@ async function createWindow() { * @param {Event} event * @returns `true` if the url is allowed, `false` otherwise */ - function validateDomain(event) { if (config == undefined) return true; @@ -181,7 +179,7 @@ function testAndLoadUrl(testurl) { //------------------------------------------------------------------------------ -// Init electon app +// Init electron app //------------------------------------------------------------------------------ app.whenReady().then(() => { @@ -193,14 +191,16 @@ app.whenReady().then(() => { } createWindow(); - - app.on('activate', () => { - if (BrowserWindow.getAllWindows().length === 0) { - createWindow(); - } - }) }); +Menu.setApplicationMenu(null); + app.on('window-all-closed', () => { app.quit() }); + +app.on('activate', () => { + if (BrowserWindow.getAllWindows().length === 0) { + createWindow(); + } +}) \ No newline at end of file