mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
isNotFirstInstance -> isSecondInstance
This commit is contained in:
@@ -701,7 +701,7 @@ starts:
|
||||
const {app} = require('electron')
|
||||
let myWindow = null
|
||||
|
||||
const isNotFirstInstance = app.makeSingleInstance((commandLine, workingDirectory) => {
|
||||
const isSecondInstance = app.makeSingleInstance((commandLine, workingDirectory) => {
|
||||
// Someone tried to run a second instance, we should focus our window.
|
||||
if (myWindow) {
|
||||
if (myWindow.isMinimized()) myWindow.restore()
|
||||
@@ -709,8 +709,8 @@ const isNotFirstInstance = app.makeSingleInstance((commandLine, workingDirectory
|
||||
}
|
||||
})
|
||||
|
||||
if (isNotFirstInstance) {
|
||||
app.quit();
|
||||
if (isSecondInstance) {
|
||||
app.quit()
|
||||
}
|
||||
|
||||
// Create myWindow, load the rest of the app, etc...
|
||||
|
||||
Reference in New Issue
Block a user