diff --git a/src/helpers/ipc.js b/src/helpers/ipc.js index f78bb81c..c7fa28f7 100644 --- a/src/helpers/ipc.js +++ b/src/helpers/ipc.js @@ -47,17 +47,20 @@ function ipcRendererSendCommand(id: string, data: In): Observable { if (requestId !== msg.requestId) return switch (msg.type) { case 'NEXT': + console.log('<= COMMAND next', msg) if (msg.data) { o.next(msg.data) } break case 'COMPLETE': + console.log('<= COMMAND complete', msg) o.complete() ipcRenderer.removeListener('command-event', handleCommandEvent) break case 'ERROR': + console.warn('<= COMMAND error', msg) o.error(msg.data) ipcRenderer.removeListener('command-event', handleCommandEvent) break @@ -70,6 +73,8 @@ function ipcRendererSendCommand(id: string, data: In): Observable { ipcRenderer.send('command', { id, data, requestId }) + console.log('=> COMMAND', { id, data, requestId }) + return unsubscribe }) } diff --git a/src/internals/index.js b/src/internals/index.js index a2d77efe..8cfb9226 100644 --- a/src/internals/index.js +++ b/src/internals/index.js @@ -9,7 +9,6 @@ process.title = 'Internal' const subscriptions = {} process.on('message', m => { - console.log(m) if (m.type === 'command') { const { data, requestId, id } = m.command const cmd = commands.find(cmd => cmd.id === id) @@ -56,4 +55,4 @@ process.on('message', m => { } }) -console.log('Internal process is ready!') +console.log('Internal process is up!') diff --git a/src/renderer/init.js b/src/renderer/init.js index 103ee782..1702884f 100644 --- a/src/renderer/init.js +++ b/src/renderer/init.js @@ -6,7 +6,6 @@ import { render } from 'react-dom' import { AppContainer } from 'react-hot-loader' import createHistory from 'history/createHashHistory' import moment from 'moment' -import { delay } from 'helpers/promise' import createStore from 'renderer/createStore' import events from 'renderer/events' @@ -73,10 +72,7 @@ async function init() { if (isMainWindow) { events({ store, locked }) - const libcoreVersion = await Promise.race([ - libcoreGetVersion.send().toPromise(), - delay(10000).then(() => Promise.reject(new Error("timeout: can't load libcore"))), - ]) + const libcoreVersion = await libcoreGetVersion.send().toPromise() console.log('libcore', libcoreVersion) } }