Browse Source

Quit app if not main instance

master
meriadec 7 years ago
parent
commit
84e5662068
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 11
      src/main/app.js

11
src/main/app.js

@ -17,6 +17,17 @@ import { terminateAllTheThings } from './terminator'
// necessary to prevent win from being garbage collected
let mainWindow = null
const isSecondInstance = app.makeSingleInstance(() => {
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore()
mainWindow.focus()
}
})
if (isSecondInstance) {
app.quit()
}
export const getMainWindow = () => mainWindow
// TODO put back OSX close behavior

Loading…
Cancel
Save