diff options
author | bitpshr <mail@bitpshr.net> | 2018-04-17 05:45:18 +0800 |
---|---|---|
committer | bitpshr <mail@bitpshr.net> | 2018-04-17 06:12:05 +0800 |
commit | b4912f29cd3b6e0a5df81e9f69acc50b03e31c0c (patch) | |
tree | 16920399eb3be919d017148b299dd61d68b5d92d /app/scripts/background.js | |
parent | d0447f90583275868bb72aa7ae8f670bf3668173 (diff) | |
download | tangerine-wallet-browser-b4912f29cd3b6e0a5df81e9f69acc50b03e31c0c.tar.gz tangerine-wallet-browser-b4912f29cd3b6e0a5df81e9f69acc50b03e31c0c.tar.zst tangerine-wallet-browser-b4912f29cd3b6e0a5df81e9f69acc50b03e31c0c.zip |
Disable token price polling when no client is active
Diffstat (limited to 'app/scripts/background.js')
-rw-r--r-- | app/scripts/background.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js index 5878cd2e8..3f0e289c9 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -200,6 +200,7 @@ function setupController (initState, initLangCode) { if (isMetaMaskInternalProcess) { // communication with popup popupIsOpen = popupIsOpen || (remotePort.name === 'popup') + controller.isClientOpen = true controller.setupTrustedCommunication(portStream, 'MetaMask') // record popup as closed if (remotePort.sender.url.match(/home.html$/)) { @@ -211,6 +212,8 @@ function setupController (initState, initLangCode) { if (remotePort.sender.url.match(/home.html$/)) { openMetamaskTabsIDs[remotePort.sender.tab.id] = false } + controller.isClientOpen = popupIsOpen || + Object.keys(openMetamaskTabsIDs).some(key => openMetamaskTabsIDs[key]) }) } if (remotePort.name === 'notification') { |