diff options
author | Esteban MIno <efmino@uc.cl> | 2018-07-21 07:58:03 +0800 |
---|---|---|
committer | Esteban MIno <efmino@uc.cl> | 2018-07-21 07:58:03 +0800 |
commit | 9c955549338f49d8b5eb6ca003c2c65c725aa328 (patch) | |
tree | 85896b5860ddc29f68168917d33c691e5e007e3f /app/scripts/controllers | |
parent | e6ca7948e75af8e9a8b8ceb62de9ebb573fe33b3 (diff) | |
download | tangerine-wallet-browser-9c955549338f49d8b5eb6ca003c2c65c725aa328.tar.gz tangerine-wallet-browser-9c955549338f49d8b5eb6ca003c2c65c725aa328.tar.zst tangerine-wallet-browser-9c955549338f49d8b5eb6ca003c2c65c725aa328.zip |
fix detection on submit password
Diffstat (limited to 'app/scripts/controllers')
-rw-r--r-- | app/scripts/controllers/detect-tokens.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/app/scripts/controllers/detect-tokens.js b/app/scripts/controllers/detect-tokens.js index f1810cfa1..4fe4b4c61 100644 --- a/app/scripts/controllers/detect-tokens.js +++ b/app/scripts/controllers/detect-tokens.js @@ -64,10 +64,9 @@ class DetectTokensController { * */ restartTokenDetection () { - if (this.isActive && this.selectedAddress) { - this.detectNewTokens() - this.interval = DEFAULT_INTERVAL - } + if (!(this.isActive && this.selectedAddress)) { return } + this.detectNewTokens() + this.interval = DEFAULT_INTERVAL } /** @@ -113,11 +112,15 @@ class DetectTokensController { this._keyringMemStore = keyringMemStore this._keyringMemStore.subscribe(({ isUnlocked }) => { if (this.isUnlocked !== isUnlocked) { - if (isUnlocked) { this.restartTokenDetection() } this.isUnlocked = isUnlocked + if (isUnlocked) { this.restartTokenDetection() } } }) } + + get isActive () { + return this.isOpen && this.isUnlocked + } } module.exports = DetectTokensController |