feat: 限制只能启动一个应用

This commit is contained in:
alger
2024-01-04 09:39:37 +08:00
parent 7ab43d2e9e
commit 67d42a2291
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -61,6 +61,12 @@ function createWindow() {
}
}
// 限制只能启动一个应用
const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
app.quit()
}
app.whenReady().then(createWindow)
app.on('ready',()=>{