Skip to content

Commit 91e60fa

Browse files
committed
fix IPC bug: spawn 2 finder processes
1 parent 0cc52c2 commit 91e60fa

1 file changed

Lines changed: 16 additions & 18 deletions

File tree

main.js

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -274,26 +274,24 @@ app.on('ready', function () {
274274
mainWindow.hide()
275275
})
276276

277-
mainWindow.webContents.on('did-finish-load', function () {
278-
if (finderProcess == null && process.platform === 'darwin') {
279-
spawnFinder()
280-
} else {
281-
finderWindow = require('./atom-lib/finder-window')
282-
283-
finderWindow.on('close', function (e) {
284-
if (appQuit) return true
285-
e.preventDefault()
286-
finderWindow.hide()
287-
})
288-
}
289-
290-
nodeIpc.server.start(function (err) {
291-
if (err.code === 'EADDRINUSE') {
292-
notify('Error occurs!', 'You have to kill other Boostnote processes.')
293-
quitApp()
294-
}
277+
if (finderProcess == null && process.platform === 'darwin') {
278+
console.log('fired only once ')
279+
spawnFinder()
280+
} else {
281+
finderWindow = require('./atom-lib/finder-window')
282+
283+
finderWindow.on('close', function (e) {
284+
if (appQuit) return true
285+
e.preventDefault()
286+
finderWindow.hide()
295287
})
288+
}
296289

290+
nodeIpc.server.start(function (err) {
291+
if (err.code === 'EADDRINUSE') {
292+
notify('Error occurs!', 'You have to kill other Boostnote processes.')
293+
quitApp()
294+
}
297295
})
298296

299297
require('./hotkey')

0 commit comments

Comments
 (0)