aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Finlay <542863+danfinlay@users.noreply.github.com>2018-04-19 02:44:14 +0800
committerGitHub <noreply@github.com>2018-04-19 02:44:14 +0800
commit0a14cedaf1b63a334da5384c2c9cd3c6a91f877a (patch)
treee6ab38bd8113495c732cca746963f3b01b41e407 /ui
parent40f0a40edfdb928f824f08ed0ba39a707825e2d3 (diff)
parent2c8156ebe91941309d49e8f8f1ed8e9d740bb9de (diff)
downloadtangerine-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 'ui')
-rw-r--r--ui/app/actions.js16
-rw-r--r--ui/app/app.js14
2 files changed, 27 insertions, 3 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index f5cdd32bc..73335db97 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -351,7 +351,6 @@ function confirmSeedWords () {
log.debug(`background.clearSeedWordCache`)
return new Promise((resolve, reject) => {
background.clearSeedWordCache((err, account) => {
- dispatch(actions.hideLoadingIndication())
if (err) {
dispatch(actions.displayWarning(err.message))
return reject(err)
@@ -362,6 +361,9 @@ function confirmSeedWords () {
resolve(account)
})
})
+ .then(() => dispatch(setIsRevealingSeedWords(false)))
+ .then(() => dispatch(actions.hideLoadingIndication()))
+ .catch(() => dispatch(actions.hideLoadingIndication()))
}
}
@@ -446,11 +448,13 @@ function requestRevealSeed (password) {
}
dispatch(actions.showNewVaultSeed(result))
- dispatch(actions.hideLoadingIndication())
resolve()
})
})
})
+ .then(() => dispatch(setIsRevealingSeedWords(true)))
+ .then(() => dispatch(actions.hideLoadingIndication()))
+ .catch(() => dispatch(actions.hideLoadingIndication()))
}
}
@@ -1907,3 +1911,11 @@ function updateNetworkEndpointType (networkEndpointType) {
value: networkEndpointType,
}
}
+
+function setIsRevealingSeedWords (reveal) {
+ return dispatch => {
+ log.debug(`background.setIsRevealingSeedWords`)
+ background.setIsRevealingSeedWords(reveal)
+ return forceUpdateMetamaskState(dispatch)
+ }
+}
diff --git a/ui/app/app.js b/ui/app/app.js
index 827b4e9ce..1667e848d 100644
--- a/ui/app/app.js
+++ b/ui/app/app.js
@@ -56,11 +56,20 @@ const {
class App extends Component {
componentWillMount () {
- const { currentCurrency, setCurrentCurrencyToUSD } = this.props
+ const {
+ currentCurrency,
+ setCurrentCurrencyToUSD,
+ isRevealingSeedWords,
+ clearSeedWords,
+ } = this.props
if (!currentCurrency) {
setCurrentCurrencyToUSD()
}
+
+ if (isRevealingSeedWords) {
+ clearSeedWords()
+ }
}
renderRoutes () {
@@ -406,6 +415,8 @@ App.propTypes = {
isMouseUser: PropTypes.bool,
setMouseUserState: PropTypes.func,
t: PropTypes.func,
+ isRevealingSeedWords: PropTypes.bool,
+ clearSeedWords: PropTypes.func,
}
function mapStateToProps (state) {
@@ -486,6 +497,7 @@ function mapDispatchToProps (dispatch, ownProps) {
setCurrentCurrencyToUSD: () => dispatch(actions.setCurrentCurrency('usd')),
toggleAccountMenu: () => dispatch(actions.toggleAccountMenu()),
setMouseUserState: (isMouseUser) => dispatch(actions.setMouseUserState(isMouseUser)),
+ clearSeedWords: () => dispatch(actions.confirmSeedWords()),
}
}