aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2018-04-19 13:32:24 +0800
committerGitHub <noreply@github.com>2018-04-19 13:32:24 +0800
commit73b2960e7f52e602af02a3fe4b2b457e740c00b5 (patch)
tree85aeeb856c8995f09b0b1187b149d022fa0fc666 /ui
parent4544d57f2632ce5a00dc8780a7b360ab9b2657c3 (diff)
parent1d80a4c452cc41b28e0a6a565b8fd48f0ff0252d (diff)
downloadtangerine-wallet-browser-73b2960e7f52e602af02a3fe4b2b457e740c00b5.tar
tangerine-wallet-browser-73b2960e7f52e602af02a3fe4b2b457e740c00b5.tar.gz
tangerine-wallet-browser-73b2960e7f52e602af02a3fe4b2b457e740c00b5.tar.bz2
tangerine-wallet-browser-73b2960e7f52e602af02a3fe4b2b457e740c00b5.tar.lz
tangerine-wallet-browser-73b2960e7f52e602af02a3fe4b2b457e740c00b5.tar.xz
tangerine-wallet-browser-73b2960e7f52e602af02a3fe4b2b457e740c00b5.tar.zst
tangerine-wallet-browser-73b2960e7f52e602af02a3fe4b2b457e740c00b5.zip
Merge pull request #4026 from MetaMask/i4015-oldui-seed
Fix exception thrown when revealing seed words
Diffstat (limited to 'ui')
-rw-r--r--ui/app/actions.js24
1 files changed, 18 insertions, 6 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 73335db97..81d9c333b 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -345,10 +345,9 @@ function transitionBackward () {
}
}
-function confirmSeedWords () {
+function clearSeedWordCache () {
+ log.debug(`background.clearSeedWordCache`)
return dispatch => {
- dispatch(actions.showLoadingIndication())
- log.debug(`background.clearSeedWordCache`)
return new Promise((resolve, reject) => {
background.clearSeedWordCache((err, account) => {
if (err) {
@@ -361,9 +360,22 @@ function confirmSeedWords () {
resolve(account)
})
})
- .then(() => dispatch(setIsRevealingSeedWords(false)))
- .then(() => dispatch(actions.hideLoadingIndication()))
- .catch(() => dispatch(actions.hideLoadingIndication()))
+ }
+}
+
+function confirmSeedWords () {
+ return async dispatch => {
+ dispatch(actions.showLoadingIndication())
+ const account = await dispatch(clearSeedWordCache())
+ return dispatch(setIsRevealingSeedWords(false))
+ .then(() => {
+ dispatch(actions.hideLoadingIndication())
+ return account
+ })
+ .catch(() => {
+ dispatch(actions.hideLoadingIndication())
+ return account
+ })
}
}