diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-03-28 23:23:25 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-03-28 23:23:25 +0800 |
commit | a95d96d507b9b20e0457baae9f9d38e26b23d8b3 (patch) | |
tree | 19fc948c1a1c01900f1ae4d064b90eae6d2dd0d8 | |
parent | 903d3aeb7a3482f9de1d43d5634bdfec59715288 (diff) | |
download | tangerine-wallet-browser-a95d96d507b9b20e0457baae9f9d38e26b23d8b3.tar tangerine-wallet-browser-a95d96d507b9b20e0457baae9f9d38e26b23d8b3.tar.gz tangerine-wallet-browser-a95d96d507b9b20e0457baae9f9d38e26b23d8b3.tar.bz2 tangerine-wallet-browser-a95d96d507b9b20e0457baae9f9d38e26b23d8b3.tar.lz tangerine-wallet-browser-a95d96d507b9b20e0457baae9f9d38e26b23d8b3.tar.xz tangerine-wallet-browser-a95d96d507b9b20e0457baae9f9d38e26b23d8b3.tar.zst tangerine-wallet-browser-a95d96d507b9b20e0457baae9f9d38e26b23d8b3.zip |
Assure that seed words are placed into state tree upon request.
-rw-r--r-- | app/scripts/metamask-controller.js | 2 | ||||
-rw-r--r-- | ui/app/actions.js | 4 | ||||
-rw-r--r-- | ui/app/keychains/hd/recover-seed/confirmation.js | 32 | ||||
-rw-r--r-- | ui/app/reducers/metamask.js | 1 |
4 files changed, 6 insertions, 33 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 92533e022..c0c113a45 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -386,7 +386,7 @@ module.exports = class MetamaskController extends EventEmitter { .then((serialized) => { const seedWords = serialized.mnemonic this.configManager.setSeedWords(seedWords) - cb() + cb(null, seedWords) }) } diff --git a/ui/app/actions.js b/ui/app/actions.js index 7288db256..9c3ab059c 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -273,8 +273,10 @@ function requestRevealSeed (password) { return dispatch(actions.displayWarning(err.message)) } log.debug(`background.placeSeedWords`) - background.placeSeedWords((err) => { + background.placeSeedWords((err, result) => { if (err) return dispatch(actions.displayWarning(err.message)) + dispatch(actions.hideLoadingIndication()) + dispatch(actions.showNewVaultSeed(result)) }) }) } diff --git a/ui/app/keychains/hd/recover-seed/confirmation.js b/ui/app/keychains/hd/recover-seed/confirmation.js index 56ac461ea..4ccbec9fc 100644 --- a/ui/app/keychains/hd/recover-seed/confirmation.js +++ b/ui/app/keychains/hd/recover-seed/confirmation.js @@ -18,11 +18,8 @@ function mapStateToProps (state) { } } -RevealSeedConfirmation.prototype.confirmationPhrase = 'I understand' - RevealSeedConfirmation.prototype.render = function () { const props = this.props - const state = this.state return ( @@ -64,31 +61,13 @@ RevealSeedConfirmation.prototype.render = function () { }, }), - h(`h4${state && state.confirmationWrong ? '.error' : ''}`, { - style: { - marginTop: '12px', - }, - }, `Enter the phrase "${this.confirmationPhrase}" to proceed.`), - - // confirm confirmation - h('input.large-input.letter-spacey', { - type: 'text', - id: 'confirm-box', - placeholder: this.confirmationPhrase, - onKeyPress: this.checkConfirmation.bind(this), - style: { - width: 260, - marginTop: 16, - }, - }), - h('.flex-row.flex-space-between', { style: { marginTop: 30, width: '50%', }, }, [ -// cancel + // cancel h('button.primary', { onClick: this.goHome.bind(this), }, 'CANCEL'), @@ -134,15 +113,6 @@ RevealSeedConfirmation.prototype.checkConfirmation = function (event) { } RevealSeedConfirmation.prototype.revealSeedWords = function () { - this.setState({ confirmationWrong: false }) - - const confirmBox = document.getElementById('confirm-box') - const confirmation = confirmBox.value - if (confirmation !== this.confirmationPhrase) { - confirmBox.value = '' - return this.setState({ confirmationWrong: true }) - } - var password = document.getElementById('password-box').value this.props.dispatch(actions.requestRevealSeed(password)) } diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js index 2b5151466..e0c416c2d 100644 --- a/ui/app/reducers/metamask.js +++ b/ui/app/reducers/metamask.js @@ -94,6 +94,7 @@ function reduceMetamask (state, action) { return extend(metamaskState, { isUnlocked: true, isInitialized: false, + seedWords: action.value, }) case actions.CLEAR_SEED_WORD_CACHE: |