diff options
background - stream disconnection fix
Diffstat (limited to 'app/scripts/background.js')
-rw-r--r-- | app/scripts/background.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js index 18882e5d5..744a0caee 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -122,17 +122,16 @@ function setupController (initState) { // remote features // - function setupControllerConnection (stream) { - controller.stream = stream + function setupControllerConnection (outStream) { var api = controller.getApi() var dnode = Dnode(api) - stream.pipe(dnode).pipe(stream) + outStream.pipe(dnode).pipe(outStream) dnode.on('remote', (remote) => { // push updates to popup var sendUpdate = remote.sendUpdate.bind(remote) controller.on('update', sendUpdate) // teardown on disconnect - eos(stream, () => { + eos(outStream, () => { controller.removeListener('update', sendUpdate) popupIsOpen = false }) |