Prevent a second instance.
This commit is contained in:
parent
5aad0dfe34
commit
95bcc1a6b4
8
main.js
8
main.js
|
@ -15,6 +15,10 @@ const isMac = process.platform === 'darwin'
|
|||
const isWin = process.platform === 'win32'
|
||||
|
||||
function initApp() {
|
||||
if (!app.requestSingleInstanceLock()) {
|
||||
app.quit();
|
||||
}
|
||||
|
||||
createWindow()
|
||||
// Set Windows platform notifications
|
||||
if (isWin) {
|
||||
|
@ -120,6 +124,10 @@ app.on('activate', function () {
|
|||
}
|
||||
})
|
||||
|
||||
app.on('second-instance', function () {
|
||||
mainWindow.show();
|
||||
});
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
|
||||
|
|
Loading…
Reference in New Issue