aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-05-31 08:03:40 +0800
committerDan <danjm.com@gmail.com>2018-05-31 08:03:40 +0800
commit0f3480a97f2924de899e49a095ef24b9fa5506f1 (patch)
tree875be80f14da156680b14cc70f812039f22a4114 /ui/app/components
parent1c3d2aa18b85ddb83734d6afdbb1111ba0791229 (diff)
downloadtangerine-wallet-browser-0f3480a97f2924de899e49a095ef24b9fa5506f1.tar
tangerine-wallet-browser-0f3480a97f2924de899e49a095ef24b9fa5506f1.tar.gz
tangerine-wallet-browser-0f3480a97f2924de899e49a095ef24b9fa5506f1.tar.bz2
tangerine-wallet-browser-0f3480a97f2924de899e49a095ef24b9fa5506f1.tar.lz
tangerine-wallet-browser-0f3480a97f2924de899e49a095ef24b9fa5506f1.tar.xz
tangerine-wallet-browser-0f3480a97f2924de899e49a095ef24b9fa5506f1.tar.zst
tangerine-wallet-browser-0f3480a97f2924de899e49a095ef24b9fa5506f1.zip
Fix then-catch + error handling in import-account
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/pages/create-account/import-account/json.js3
-rw-r--r--ui/app/components/pages/create-account/import-account/private-key.js3
2 files changed, 2 insertions, 4 deletions
diff --git a/ui/app/components/pages/create-account/import-account/json.js b/ui/app/components/pages/create-account/import-account/json.js
index 3dabad68e..23b7f0afd 100644
--- a/ui/app/components/pages/create-account/import-account/json.js
+++ b/ui/app/components/pages/create-account/import-account/json.js
@@ -106,8 +106,6 @@ class JsonImportSubview extends Component {
}
importNewJsonAccount([ fileContents, password ])
- // JS runtime requires caught rejections but failures are handled by Redux
- .catch()
.then(({ selectedAddress }) => {
if (selectedAddress) {
history.push(DEFAULT_ROUTE)
@@ -116,6 +114,7 @@ class JsonImportSubview extends Component {
setSelectedAddress(firstAddress)
}
})
+ .catch(err => displayWarning(err))
}
}
diff --git a/ui/app/components/pages/create-account/import-account/private-key.js b/ui/app/components/pages/create-account/import-account/private-key.js
index e71e47647..81cef09f9 100644
--- a/ui/app/components/pages/create-account/import-account/private-key.js
+++ b/ui/app/components/pages/create-account/import-account/private-key.js
@@ -96,8 +96,6 @@ PrivateKeyImportView.prototype.createNewKeychain = function () {
const { importNewAccount, history, displayWarning, setSelectedAddress, firstAddress } = this.props
importNewAccount('Private Key', [ privateKey ])
- // JS runtime requires caught rejections but failures are handled by Redux
- .catch()
.then(({ selectedAddress }) => {
if (selectedAddress) {
history.push(DEFAULT_ROUTE)
@@ -106,4 +104,5 @@ PrivateKeyImportView.prototype.createNewKeychain = function () {
setSelectedAddress(firstAddress)
}
})
+ .catch(err => displayWarning(err))
}