Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix electron not running under windows (after async changes) #3091

Merged
merged 1 commit into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
});
});
}