Fix the failing sendSync
This commit is contained in:
parent
95e7c796ec
commit
647f151906
1 changed files with 5 additions and 1 deletions
|
@ -119,6 +119,10 @@ metaToPlainObject = (meta) ->
|
||||||
|
|
||||||
# Browser calls a callback in renderer.
|
# Browser calls a callback in renderer.
|
||||||
ipcRenderer.on 'ATOM_RENDERER_CALLBACK', (event, id, args) ->
|
ipcRenderer.on 'ATOM_RENDERER_CALLBACK', (event, id, args) ->
|
||||||
|
# Delay the callback to next tick in case the browser is still in the middle
|
||||||
|
# of sending this message while the callback sends a sync message to browser,
|
||||||
|
# which can fail sometimes.
|
||||||
|
setImmediate ->
|
||||||
callbacksRegistry.apply id, metaToValue(args)
|
callbacksRegistry.apply id, metaToValue(args)
|
||||||
|
|
||||||
# A callback in browser is released.
|
# A callback in browser is released.
|
||||||
|
|
Loading…
Reference in a new issue