some clean up

This commit is contained in:
2024-05-29 22:50:18 +02:00
parent fc4b271cc6
commit 1ddead6d4a
+10 -10
View File
@@ -29,7 +29,7 @@ let win;
* - Linux: `app.getPath('exe')` * - Linux: `app.getPath('exe')`
* - MacOS: `path.resolve(app.getPath('exe'), "../../../../")` * - MacOS: `path.resolve(app.getPath('exe'), "../../../../")`
* 3. `__dirname` (Development) * 3. `__dirname` (Development)
*/ */
function loadConfig() { function loadConfig() {
const locations = [ const locations = [
'/assets/presentation', '/assets/presentation',
@@ -81,7 +81,6 @@ async function createWindow() {
}); });
nativeTheme.themeSource = 'dark'; nativeTheme.themeSource = 'dark';
Menu.setApplicationMenu(null);
// register event callbacks // register event callbacks
win.on("closed", function () { win = null; }); win.on("closed", function () { win = null; });
@@ -124,7 +123,6 @@ async function createWindow() {
* @param {Event} event * @param {Event} event
* @returns `true` if the url is allowed, `false` otherwise * @returns `true` if the url is allowed, `false` otherwise
*/ */
function validateDomain(event) { function validateDomain(event) {
if (config == undefined) return true; if (config == undefined) return true;
@@ -181,7 +179,7 @@ function testAndLoadUrl(testurl) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Init electon app // Init electron app
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
app.whenReady().then(() => { app.whenReady().then(() => {
@@ -193,14 +191,16 @@ app.whenReady().then(() => {
} }
createWindow(); createWindow();
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
})
}); });
Menu.setApplicationMenu(null);
app.on('window-all-closed', () => { app.on('window-all-closed', () => {
app.quit() app.quit()
}); });
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
})