diff options
author | Josh Stevens <joshstevens19@hotmail.co.uk> | 2019-03-22 03:42:23 +0800 |
---|---|---|
committer | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2019-03-22 03:42:23 +0800 |
commit | 2aaec1d9fbaa340ee9971278b6fafd1ad49bdbf2 (patch) | |
tree | dc37991286b8014f921b56335f5de224daf4d241 /app/scripts/lib | |
parent | e1af6312cea0d2b07b7b3a4fae4c4ca5857a03eb (diff) | |
download | tangerine-wallet-browser-2aaec1d9fbaa340ee9971278b6fafd1ad49bdbf2.tar tangerine-wallet-browser-2aaec1d9fbaa340ee9971278b6fafd1ad49bdbf2.tar.gz tangerine-wallet-browser-2aaec1d9fbaa340ee9971278b6fafd1ad49bdbf2.tar.bz2 tangerine-wallet-browser-2aaec1d9fbaa340ee9971278b6fafd1ad49bdbf2.tar.lz tangerine-wallet-browser-2aaec1d9fbaa340ee9971278b6fafd1ad49bdbf2.tar.xz tangerine-wallet-browser-2aaec1d9fbaa340ee9971278b6fafd1ad49bdbf2.tar.zst tangerine-wallet-browser-2aaec1d9fbaa340ee9971278b6fafd1ad49bdbf2.zip |
Stop reloading dapps on network change allowing dapps to decide if it should refresh or not (#6330)
* feat: `inpageProvider.autoRefreshOnNetworkChange` to allow dapps to control if it refreshes or not
* feat: check the `autoRefreshOnNetworkChange` before a refresh
* fix linting error
* fix: use `window.ethereum` now `web3.ethereum`
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/auto-reload.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/scripts/lib/auto-reload.js b/app/scripts/lib/auto-reload.js index 558391a06..44fbe847c 100644 --- a/app/scripts/lib/auto-reload.js +++ b/app/scripts/lib/auto-reload.js @@ -20,6 +20,10 @@ function setupDappAutoReload (web3, observable) { }) observable.subscribe(function (state) { + // if the auto refresh on network change is false do not + // do anything + if (!window.ethereum.autoRefreshOnNetworkChange) return + // if reload in progress, no need to check reload logic if (reloadInProgress) return |