1
0
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:
Rokt33r
2015-12-22 11:29:57 +09:00
parent 0cc52c2206
commit 91e60fa82b

32
main.js
View File

@@ -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')