From eeda7c17c5b1fc3923bf83b7b9032e26b9dec7c0 Mon Sep 17 00:00:00 2001 From: DC Date: Tue, 17 May 2016 05:11:42 -0700 Subject: [PATCH] Wait for the app ready event before creating windows Fixes #524 --- main/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/index.js b/main/index.js index 2f61ba8c..76632ad2 100644 --- a/main/index.js +++ b/main/index.js @@ -43,6 +43,7 @@ function init () { app.setPath('userData', config.CONFIG_PATH) } + app.isReady = false // app ready, windows can be created app.ipcReady = false // main window has finished loading and IPC is ready app.isQuitting = false @@ -57,6 +58,8 @@ function init () { }) app.on('ready', function () { + app.isReady = true + windows.createMainWindow() windows.createWebTorrentHiddenWindow() menu.init() @@ -83,7 +86,7 @@ function init () { }) app.on('activate', function () { - windows.createMainWindow() + if (app.isReady) windows.createMainWindow() }) }