Skip to content

Commit

Permalink
fix electron not running under windows (after async changes)
Browse files Browse the repository at this point in the history
  • Loading branch information
khassel committed Apr 11, 2023
1 parent 4e33690 commit 2f38615
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 7 additions & 8 deletions js/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
});
});
}

0 comments on commit 2f38615

Please sign in to comment.