Skip to content

Commit

Permalink
feat: show window on refocusing app
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswhong committed Sep 4, 2019
1 parent f55b0a7 commit 899b103
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions app/main.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ const setMenuItemEnabled = (menuItemIds, enabled) => {
})
}

let quitting = false

app.on('ready', () =>
installExtensions()
.then(() => {
Expand Down Expand Up @@ -146,10 +148,10 @@ app.on('ready', () =>
type: 'separator'
},
{
label: 'Quit',
label: 'Quit Qri Desktop',
accelerator: 'Command+Q',
click () {
app.quit()
quitting = true; app.quit()
}
}
]
Expand Down Expand Up @@ -475,4 +477,15 @@ app.on('ready', () =>
]
setMenuItemEnabled(blockableMenus, !blockMenus)
})

mainWindow.on('close', (e) => {
if (!quitting) {
e.preventDefault()
Menu.sendActionToFirstResponder('hide:')
}
})

app.on('activate', () => {
mainWindow.show()
})
}))

0 comments on commit 899b103

Please sign in to comment.