From 91e60fa82b77f5210344a26843c3658f01992131 Mon Sep 17 00:00:00 2001 From: Rokt33r Date: Tue, 22 Dec 2015 11:29:57 +0900 Subject: [PATCH] fix IPC bug: spawn 2 finder processes --- main.js | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/main.js b/main.js index ed2ddcdb..bedbe6da 100644 --- a/main.js +++ b/main.js @@ -274,26 +274,24 @@ app.on('ready', function () { mainWindow.hide() }) - mainWindow.webContents.on('did-finish-load', function () { - if (finderProcess == null && process.platform === 'darwin') { - spawnFinder() - } else { - finderWindow = require('./atom-lib/finder-window') + if (finderProcess == null && process.platform === 'darwin') { + console.log('fired only once ') + spawnFinder() + } else { + finderWindow = require('./atom-lib/finder-window') - finderWindow.on('close', function (e) { - if (appQuit) return true - e.preventDefault() - finderWindow.hide() - }) - } - - nodeIpc.server.start(function (err) { - if (err.code === 'EADDRINUSE') { - notify('Error occurs!', 'You have to kill other Boostnote processes.') - quitApp() - } + finderWindow.on('close', function (e) { + if (appQuit) return true + e.preventDefault() + finderWindow.hide() }) + } + nodeIpc.server.start(function (err) { + if (err.code === 'EADDRINUSE') { + notify('Error occurs!', 'You have to kill other Boostnote processes.') + quitApp() + } }) require('./hotkey')