Skip to content

Commit

Permalink
Fix macos reopen bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrc356 committed Jul 9, 2019
1 parent 4429050 commit cccf0fa
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions app/main.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@ app.on('window-all-closed', () => {
}
});

app.on('ready', async () => {
if (
process.env.NODE_ENV === 'development' ||
process.env.DEBUG_PROD === 'true'
) {
await installExtensions();
app.on('activate', () => {
// On macOS 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 === null) {
createWindow();
}
});

function createWindow() {
mainWindow = new BrowserWindow({
show: false,
width: 1024,
Expand Down Expand Up @@ -99,4 +100,15 @@ app.on('ready', async () => {
// Remove this if your app does not use auto updates
// eslint-disable-next-line
new AppUpdater();
}

app.on('ready', async () => {
if (
process.env.NODE_ENV === 'development' ||
process.env.DEBUG_PROD === 'true'
) {
await installExtensions();
}

createWindow();
});

0 comments on commit cccf0fa

Please sign in to comment.