Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 57bae77

Browse files
getneilneil molina
andauthored
check if electron is ready before creating window (#552)
Co-authored-by: neil molina <neil@neils-MacBook-Pro.local>
1 parent c5decfa commit 57bae77

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

modules/desktop/electron/electron.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,14 @@ if (process.defaultApp) {
149149
app.setAsDefaultProtocolClient("tea");
150150
}
151151

152-
app.once("ready", createMainWindow);
152+
let ready = false;
153+
app.once("ready", () => {
154+
ready = true;
155+
createMainWindow();
156+
});
153157

154158
app.on("activate", () => {
155-
if (!mainWindow) {
159+
if (ready && !mainWindow) {
156160
createMainWindow();
157161
}
158162
});

0 commit comments

Comments
 (0)