aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/inpage.js
diff options
context:
space:
mode:
authorfrankiebee <frankie.diamond@gmail.com>2017-05-25 10:13:35 +0800
committerfrankiebee <frankie.diamond@gmail.com>2017-05-25 11:00:58 +0800
commit473b88f399478b47bfa53d44ef9981aeb6d9960b (patch)
tree20d0c190aa52728b80a9babc51cd7e954c89a7f3 /app/scripts/inpage.js
parentd06a812004a5acc0a26fcdd5c29254b17fca25a0 (diff)
downloadtangerine-wallet-browser-473b88f399478b47bfa53d44ef9981aeb6d9960b.tar
tangerine-wallet-browser-473b88f399478b47bfa53d44ef9981aeb6d9960b.tar.gz
tangerine-wallet-browser-473b88f399478b47bfa53d44ef9981aeb6d9960b.tar.bz2
tangerine-wallet-browser-473b88f399478b47bfa53d44ef9981aeb6d9960b.tar.lz
tangerine-wallet-browser-473b88f399478b47bfa53d44ef9981aeb6d9960b.tar.xz
tangerine-wallet-browser-473b88f399478b47bfa53d44ef9981aeb6d9960b.tar.zst
tangerine-wallet-browser-473b88f399478b47bfa53d44ef9981aeb6d9960b.zip
Reload the page when switching networks for sites that use web3
Diffstat (limited to 'app/scripts/inpage.js')
-rw-r--r--app/scripts/inpage.js21
1 files changed, 3 insertions, 18 deletions
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js
index 419f78cd6..ec764535e 100644
--- a/app/scripts/inpage.js
+++ b/app/scripts/inpage.js
@@ -31,26 +31,11 @@ web3.setProvider = function () {
console.log('MetaMask - overrode web3.setProvider')
}
console.log('MetaMask - injected web3')
-// export global web3, with usage-detection reload fn
-var triggerReload = setupDappAutoReload(web3)
-
-// listen for reset requests from metamask
-var reloadStream = inpageProvider.multiStream.createStream('reload')
-reloadStream.once('data', triggerReload)
-
-// setup ping timeout autoreload
-// LocalMessageDuplexStream does not self-close, so reload if pingStream fails
-// var pingChannel = inpageProvider.multiStream.createStream('pingpong')
-// var pingStream = new PingStream({ objectMode: true })
-// wait for first successful reponse
-
-// disable pingStream until https://github.com/MetaMask/metamask-plugin/issues/746 is resolved more gracefully
-// metamaskStream.once('data', function(){
-// pingStream.pipe(pingChannel).pipe(pingStream)
-// })
-// endOfStream(pingStream, triggerReload)
+// export global web3, with usage-detection
+setupDappAutoReload(web3, inpageProvider.publicConfigStore)
// set web3 defaultAccount
+
inpageProvider.publicConfigStore.subscribe(function (state) {
web3.eth.defaultAccount = state.selectedAddress
})