Skip to content

Commit

Permalink
fix: only createWindow on app activate when app is ready #1
Browse files Browse the repository at this point in the history
  • Loading branch information
ifedapoolarewaju committed Apr 10, 2017
1 parent 68944e3 commit df31d74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ app.on('window-all-closed', () => {
app.on('activate', () => {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (!mainWindow) createWindow()
// only call createWindow afeter mainWindow is set to null at
// mainWindow.on('closed')
if (mainWindow === null) createWindow()
})

// reduce polling frequency when app is not active.
Expand Down

0 comments on commit df31d74

Please sign in to comment.