aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/auto-reload.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-10-21 00:49:49 +0800
committerDan Finlay <dan@danfinlay.com>2016-10-21 00:49:49 +0800
commit331bb735c7e9db0aa3af66e4a994e6eb9762af81 (patch)
tree6d51948907cbfc0c002bfdc4698ec99fe100e831 /app/scripts/lib/auto-reload.js
parent94f25543691b1a26f1b33a9074ba65cb722eff48 (diff)
parent12698b946221c1145d1fe966406adb7265e6b9d2 (diff)
downloadtangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.tar
tangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.tar.gz
tangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.tar.bz2
tangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.tar.lz
tangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.tar.xz
tangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.tar.zst
tangerine-wallet-browser-331bb735c7e9db0aa3af66e4a994e6eb9762af81.zip
Merge branch 'i328-MultiVault' of github.com:MetaMask/metamask-plugin into i328-MultiVault
Diffstat (limited to 'app/scripts/lib/auto-reload.js')
-rw-r--r--app/scripts/lib/auto-reload.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/app/scripts/lib/auto-reload.js b/app/scripts/lib/auto-reload.js
index c4c8053f0..3c90905db 100644
--- a/app/scripts/lib/auto-reload.js
+++ b/app/scripts/lib/auto-reload.js
@@ -3,7 +3,7 @@ const ensnare = require('ensnare')
module.exports = setupDappAutoReload
-function setupDappAutoReload (web3, controlStream) {
+function setupDappAutoReload (web3) {
// export web3 as a global, checking for usage
var pageIsUsingWeb3 = false
var resetWasRequested = false
@@ -16,19 +16,19 @@ function setupDappAutoReload (web3, controlStream) {
global.web3 = web3
}))
- // listen for reset requests from metamask
- controlStream.once('data', function () {
+ return handleResetRequest
+
+ function handleResetRequest() {
resetWasRequested = true
// ignore if web3 was not used
if (!pageIsUsingWeb3) return
// reload after short timeout
- triggerReset()
- })
-
- // reload the page
- function triggerReset () {
- setTimeout(function () {
- global.location.reload()
- }, 500)
+ setTimeout(triggerReset, 500)
}
+
}
+
+// reload the page
+function triggerReset () {
+ global.location.reload()
+} \ No newline at end of file