Prevent a second instance.

This commit is contained in:
Keith Maika 2022-03-28 22:03:20 -04:00 committed by JC Brand
parent 5aad0dfe34
commit 2697d61ab1
1 changed files with 8 additions and 0 deletions

View File

@ -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.