aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/auto-reload.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-06-22 04:18:32 +0800
committerDan Finlay <dan@danfinlay.com>2016-06-22 04:18:32 +0800
commita08c3bc01b11fbd0e3a243359befbe9fc909edf4 (patch)
treeb79b7324139945c429ca4b6c74715d8040fdf4e1 /app/scripts/lib/auto-reload.js
parentf7f8f8b1c50be39db22a7b10c6c6db007fe590aa (diff)
downloadtangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar
tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.gz
tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.bz2
tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.lz
tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.xz
tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.zst
tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.zip
Auto linted
Diffstat (limited to 'app/scripts/lib/auto-reload.js')
-rw-r--r--app/scripts/lib/auto-reload.js15
1 files changed, 6 insertions, 9 deletions
diff --git a/app/scripts/lib/auto-reload.js b/app/scripts/lib/auto-reload.js
index 95a744b2c..b45f02009 100644
--- a/app/scripts/lib/auto-reload.js
+++ b/app/scripts/lib/auto-reload.js
@@ -3,13 +3,11 @@ const ensnare = require('./ensnare.js')
module.exports = setupDappAutoReload
-
-function setupDappAutoReload(web3, controlStream){
-
+function setupDappAutoReload (web3, controlStream) {
// export web3 as a global, checking for usage
var pageIsUsingWeb3 = false
var resetWasRequested = false
- global.web3 = ensnare(web3, once(function(){
+ global.web3 = ensnare(web3, once(function () {
// if web3 usage happened after a reset request, trigger reset late
if (resetWasRequested) return triggerReset()
// mark web3 as used
@@ -19,7 +17,7 @@ function setupDappAutoReload(web3, controlStream){
}))
// listen for reset requests from metamask
- controlStream.once('data', function(){
+ controlStream.once('data', function () {
resetWasRequested = true
// ignore if web3 was not used
if (!pageIsUsingWeb3) return
@@ -28,10 +26,9 @@ function setupDappAutoReload(web3, controlStream){
})
// reload the page
- function triggerReset(){
- setTimeout(function(){
+ function triggerReset () {
+ setTimeout(function () {
global.location.reload()
}, 500)
}
-
-} \ No newline at end of file
+}