From 979f4ec6647728215ff1cccca941548b703ad356 Mon Sep 17 00:00:00 2001 From: Karsten Hassel Date: Wed, 12 Apr 2023 08:25:07 +0200 Subject: [PATCH] fix electron not running under windows (after async changes) (#3091) fixes #3083 tested under windows 11 and linux. --- CHANGELOG.md | 1 + js/electron.js | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a159db79..36e498a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ _This release is scheduled to be released on 2023-07-01._ ### Fixed - Fix envcanada hourly forecast time (#3080) +- Fix electron not running under windows after async changes (#3083) ## [2.23.0] - 2023-04-04 diff --git a/js/electron.js b/js/electron.js index 8a474bb3..8a7c2814 100644 --- a/js/electron.js +++ b/js/electron.js @@ -126,13 +126,6 @@ function createWindow() { }); } -// This method will be called when Electron has finished -// initialization and is ready to create browser windows. -app.on("ready", function () { - Log.log("Launching application."); - createWindow(); -}); - // Quit when all windows are closed. app.on("window-all-closed", function () { if (process.env.JEST_WORKER_ID !== undefined) { @@ -178,5 +171,11 @@ app.on("certificate-error", (event, webContents, url, error, certificate, callba // Start the core application if server is run on localhost // This starts all node helpers and starts the webserver. if (["localhost", "127.0.0.1", "::1", "::ffff:127.0.0.1", undefined].includes(config.address)) { - core.start().then((c) => (config = c)); + core.start().then((c) => { + config = c; + app.whenReady().then(() => { + Log.log("Launching application."); + createWindow(); + }); + }); }