diff options
author | Frankie <frankie.pangilinan@consensys.net> | 2016-10-14 06:17:30 +0800 |
---|---|---|
committer | Frankie <frankie.pangilinan@consensys.net> | 2016-10-14 06:17:30 +0800 |
commit | b200f74d5f414408881fc56b44dc3c7c7bbb7996 (patch) | |
tree | 84d0dd8585b1fe6bd252a655f8e289fc3bee271e /app/scripts/lib/auto-reload.js | |
parent | c400f7c0f6bff13400eedcd80fdc83e572eb42a8 (diff) | |
parent | 8d5b2478e3aa939cb4b0a58b20b199cded62769e (diff) | |
download | tangerine-wallet-browser-b200f74d5f414408881fc56b44dc3c7c7bbb7996.tar tangerine-wallet-browser-b200f74d5f414408881fc56b44dc3c7c7bbb7996.tar.gz tangerine-wallet-browser-b200f74d5f414408881fc56b44dc3c7c7bbb7996.tar.bz2 tangerine-wallet-browser-b200f74d5f414408881fc56b44dc3c7c7bbb7996.tar.lz tangerine-wallet-browser-b200f74d5f414408881fc56b44dc3c7c7bbb7996.tar.xz tangerine-wallet-browser-b200f74d5f414408881fc56b44dc3c7c7bbb7996.tar.zst tangerine-wallet-browser-b200f74d5f414408881fc56b44dc3c7c7bbb7996.zip |
Merge branch 'master' into i#495CustomGasField
Diffstat (limited to 'app/scripts/lib/auto-reload.js')
-rw-r--r-- | app/scripts/lib/auto-reload.js | 22 |
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 |