Skip to content

Commit

Permalink
Merge pull request #41 from holochain/fix-quit
Browse files Browse the repository at this point in the history
Fix CMD+Q on macOS
  • Loading branch information
lucksus authored Dec 2, 2019
2 parents 6e99a9e + 8aeb3e2 commit e34025f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion holoscape.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class Holoscape {
{ type: 'separator' },
{ label: 'Install hApp...', click: ()=>this.installBundleWindow.show() },
{ type: 'separator' },
{ label: 'Quit', click: ()=>{this.shutdownConductor(); this.quitting=true; mb.app.quit()} }
{ label: 'Quit', click: ()=> this.quit() }
])
mb.tray.setToolTip('HoloScape')
mb.tray.setContextMenu(contextMenu)
Expand Down Expand Up @@ -399,6 +399,12 @@ class Holoscape {
global.holoscape.checkConductorConnection()
})
}

quit() {
this.shutdownConductor()
this.quitting=true
mb.app.quit()
}
}

const systemTrayIconFull = () => {
Expand Down
6 changes: 6 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ app.on('window-all-closed', e => {
if(!global.holoscape.quitting) e.preventDefault()
})

app.on('before-quit', e => {
if(!global.holoscape.quitting) {
global.holoscape.quit()
}
})

mb.on('ready', async () => {
mb.tray.setImage(systemTrayIconEmpty())
global.holoscape = new Holoscape()
Expand Down

0 comments on commit e34025f

Please sign in to comment.