mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
@@ -5,24 +5,23 @@ const ipc = electron.ipcMain
|
||||
const GhReleases = require('electron-gh-releases')
|
||||
const { isPackaged } = app
|
||||
// electron.crashReporter.start()
|
||||
const singleInstance = app.requestSingleInstanceLock()
|
||||
|
||||
var ipcServer = null
|
||||
|
||||
var mainWindow = null
|
||||
|
||||
var shouldQuit = app.makeSingleInstance(function (commandLine, workingDirectory) {
|
||||
if (mainWindow) {
|
||||
if (process.platform === 'win32') {
|
||||
mainWindow.minimize()
|
||||
mainWindow.restore()
|
||||
}
|
||||
mainWindow.focus()
|
||||
}
|
||||
return true
|
||||
})
|
||||
|
||||
if (shouldQuit) {
|
||||
// Single Instance Lock
|
||||
if (!singleInstance) {
|
||||
app.quit()
|
||||
} else {
|
||||
app.on('second-instance', () => {
|
||||
// Someone tried to run a second instance, it should focus the existing instance.
|
||||
if (mainWindow) {
|
||||
if (!mainWindow.isVisible()) mainWindow.show()
|
||||
mainWindow.focus()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var isUpdateReady = false
|
||||
|
||||
Reference in New Issue
Block a user