diff options
author | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2018-04-19 02:44:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-19 02:44:14 +0800 |
commit | 0a14cedaf1b63a334da5384c2c9cd3c6a91f877a (patch) | |
tree | e6ab38bd8113495c732cca746963f3b01b41e407 /app | |
parent | 40f0a40edfdb928f824f08ed0ba39a707825e2d3 (diff) | |
parent | 2c8156ebe91941309d49e8f8f1ed8e9d740bb9de (diff) | |
download | tangerine-wallet-browser-0a14cedaf1b63a334da5384c2c9cd3c6a91f877a.tar tangerine-wallet-browser-0a14cedaf1b63a334da5384c2c9cd3c6a91f877a.tar.gz tangerine-wallet-browser-0a14cedaf1b63a334da5384c2c9cd3c6a91f877a.tar.bz2 tangerine-wallet-browser-0a14cedaf1b63a334da5384c2c9cd3c6a91f877a.tar.lz tangerine-wallet-browser-0a14cedaf1b63a334da5384c2c9cd3c6a91f877a.tar.xz tangerine-wallet-browser-0a14cedaf1b63a334da5384c2c9cd3c6a91f877a.tar.zst tangerine-wallet-browser-0a14cedaf1b63a334da5384c2c9cd3c6a91f877a.zip |
Merge pull request #4004 from MetaMask/i3955-reveal-seed
Fix UI getting stuck in Reveal Seed screen
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/lib/config-manager.js | 22 | ||||
-rw-r--r-- | app/scripts/metamask-controller.js | 2 |
2 files changed, 23 insertions, 1 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 34b603b96..63d27c40e 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -102,7 +102,6 @@ ConfigManager.prototype.setShowSeedWords = function (should) { this.setData(data) } - ConfigManager.prototype.getShouldShowSeedWords = function () { var data = this.getData() return data.showSeedWords @@ -118,6 +117,27 @@ ConfigManager.prototype.getSeedWords = function () { var data = this.getData() return data.seedWords } + +/** + * Called to set the isRevealingSeedWords flag. This happens only when the user chooses to reveal + * the seed words and not during the first time flow. + * @param {boolean} reveal - Value to set the isRevealingSeedWords flag. + */ +ConfigManager.prototype.setIsRevealingSeedWords = function (reveal = false) { + const data = this.getData() + data.isRevealingSeedWords = reveal + this.setData(data) +} + +/** + * Returns the isRevealingSeedWords flag. + * @returns {boolean|undefined} + */ +ConfigManager.prototype.getIsRevealingSeedWords = function () { + const data = this.getData() + return data.isRevealingSeedWords +} + ConfigManager.prototype.setRpcTarget = function (rpcUrl) { var config = this.getConfig() config.provider = { diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index a12b6776e..782bc50ac 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -308,6 +308,7 @@ module.exports = class MetamaskController extends EventEmitter { lostAccounts: this.configManager.getLostAccounts(), seedWords: this.configManager.getSeedWords(), forgottenPassword: this.configManager.getPasswordForgotten(), + isRevealingSeedWords: Boolean(this.configManager.getIsRevealingSeedWords()), }, } } @@ -347,6 +348,7 @@ module.exports = class MetamaskController extends EventEmitter { clearSeedWordCache: this.clearSeedWordCache.bind(this), resetAccount: nodeify(this.resetAccount, this), importAccountWithStrategy: this.importAccountWithStrategy.bind(this), + setIsRevealingSeedWords: this.configManager.setIsRevealingSeedWords.bind(this.configManager), // vault management submitPassword: nodeify(keyringController.submitPassword, keyringController), |