mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
fix IPC bug: spawn 2 finder processes
This commit is contained in:
32
main.js
32
main.js
@@ -274,26 +274,24 @@ app.on('ready', function () {
|
|||||||
mainWindow.hide()
|
mainWindow.hide()
|
||||||
})
|
})
|
||||||
|
|
||||||
mainWindow.webContents.on('did-finish-load', function () {
|
if (finderProcess == null && process.platform === 'darwin') {
|
||||||
if (finderProcess == null && process.platform === 'darwin') {
|
console.log('fired only once ')
|
||||||
spawnFinder()
|
spawnFinder()
|
||||||
} else {
|
} else {
|
||||||
finderWindow = require('./atom-lib/finder-window')
|
finderWindow = require('./atom-lib/finder-window')
|
||||||
|
|
||||||
finderWindow.on('close', function (e) {
|
finderWindow.on('close', function (e) {
|
||||||
if (appQuit) return true
|
if (appQuit) return true
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
finderWindow.hide()
|
finderWindow.hide()
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
nodeIpc.server.start(function (err) {
|
|
||||||
if (err.code === 'EADDRINUSE') {
|
|
||||||
notify('Error occurs!', 'You have to kill other Boostnote processes.')
|
|
||||||
quitApp()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
nodeIpc.server.start(function (err) {
|
||||||
|
if (err.code === 'EADDRINUSE') {
|
||||||
|
notify('Error occurs!', 'You have to kill other Boostnote processes.')
|
||||||
|
quitApp()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
require('./hotkey')
|
require('./hotkey')
|
||||||
|
|||||||
Reference in New Issue
Block a user