mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
multiplex - rename control to autoreload
This commit is contained in:
parent
2a62d63b4f
commit
9aea88da32
@ -25,14 +25,14 @@ pluginStream.on('error', console.error.bind(console))
|
||||
// forward communication plugin->inpage
|
||||
pageStream.pipe(pluginStream).pipe(pageStream)
|
||||
|
||||
// connect contentscript->inpage control stream
|
||||
// connect contentscript->inpage reload stream
|
||||
var mx = ObjectMultiplex()
|
||||
mx.on('error', console.error.bind(console))
|
||||
mx.pipe(pageStream)
|
||||
var controlStream = mx.createStream('control')
|
||||
controlStream.on('error', console.error.bind(console))
|
||||
var reloadStream = mx.createStream('reload')
|
||||
reloadStream.on('error', console.error.bind(console))
|
||||
|
||||
// if we lose connection with the plugin, trigger tab refresh
|
||||
pluginStream.on('close', function(){
|
||||
controlStream.write({ method: 'reset' })
|
||||
reloadStream.write({ method: 'reset' })
|
||||
})
|
@ -36,8 +36,8 @@ console.log('MetaMask - injected web3')
|
||||
// export global web3 with auto dapp reload
|
||||
//
|
||||
|
||||
var controlStream = inpageProvider.multiStream.createStream('control')
|
||||
setupDappAutoReload(web3, controlStream)
|
||||
var reloadStream = inpageProvider.multiStream.createStream('reload')
|
||||
setupDappAutoReload(web3, reloadStream)
|
||||
|
||||
// set web3 defaultAcount
|
||||
inpageProvider.publicConfigStore.subscribe(function(state){
|
||||
|
Loading…
Reference in New Issue
Block a user