From 1daf4154999ee94f98aaf52045609b3cd127ccf0 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 12 Sep 2018 17:03:03 +0300 Subject: [PATCH] Fix empty keyring on wrong password --- old-ui/app/components/confirm-change-password.js | 2 +- old-ui/app/keychains/hd/restore-vault.js | 1 - package-lock.json | 8 ++++---- package.json | 2 +- ui/app/actions.js | 6 +++++- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/old-ui/app/components/confirm-change-password.js b/old-ui/app/components/confirm-change-password.js index e613e16be..2906abd12 100644 --- a/old-ui/app/components/confirm-change-password.js +++ b/old-ui/app/components/confirm-change-password.js @@ -146,7 +146,7 @@ ConfirmChangePassword.prototype.ChangePassword = function () { props.dispatch(actions.showConfigPage()) }) .catch((err) => { - this.warning = err + this.warning = err.message props.dispatch(actions.displayWarning(this.warning)) }) } diff --git a/old-ui/app/keychains/hd/restore-vault.js b/old-ui/app/keychains/hd/restore-vault.js index 9e4c75210..2344ee034 100644 --- a/old-ui/app/keychains/hd/restore-vault.js +++ b/old-ui/app/keychains/hd/restore-vault.js @@ -156,7 +156,6 @@ RestoreVaultScreen.prototype.createNewVaultAndRestore = function () { var passwordConfirm = passwordConfirmBox.value if (password.length < 8) { this.warning = 'Password not long enough' - this.props.dispatch(actions.displayWarning(this.warning)) return } diff --git a/package-lock.json b/package-lock.json index c225edd57..686c31651 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8579,9 +8579,9 @@ } }, "eth-keychain-controller": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/eth-keychain-controller/-/eth-keychain-controller-4.0.2.tgz", - "integrity": "sha512-1NbyfdrmniEwcXdYhVeKRbw9JkqZRRexBM2QRydf613htE0jxzmQZaTMvMKV4rNL/S3fxYPd1AbLhQ3lZRiffw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eth-keychain-controller/-/eth-keychain-controller-5.0.0.tgz", + "integrity": "sha512-OOgX55AYn18br7Lt5ndD1WeyyBlZO7CvhevOsZ1CqGrcm7TWXeVjUFWO6cuYdY0mXueEGZWC/K3Ad9k8EiOKkA==", "dev": true, "requires": { "bip39": "^2.4.0", @@ -8598,7 +8598,7 @@ "dependencies": { "babelify": { "version": "7.3.0", - "resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", + "resolved": "http://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", "integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=", "dev": true, "requires": { diff --git a/package.json b/package.json index f9363ac45..e9383019d 100644 --- a/package.json +++ b/package.json @@ -245,7 +245,7 @@ "eslint-plugin-mocha": "^5.0.0", "eslint-plugin-react": "^7.4.0", "eth-json-rpc-middleware": "^1.6.0", - "eth-keychain-controller": "^4.0.2", + "eth-keychain-controller": "^5.0.0", "file-loader": "^1.1.11", "fs-promise": "^2.0.3", "ganache-cli": "^6.1.0", diff --git a/ui/app/actions.js b/ui/app/actions.js index f849b73ba..fb82e612e 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -519,6 +519,10 @@ function requestRevealSeed (password) { }) }) }) + .catch((err) => { + dispatch(actions.displayWarning(err.message)) + return Promise.reject(err) + }) } } @@ -1671,7 +1675,7 @@ function markNoticeRead (notice) { background.markNoticeRead(notice, (err, notice) => { dispatch(actions.hideLoadingIndication()) if (err) { - dispatch(actions.displayWarning(err)) + dispatch(actions.displayWarning(err.message)) return reject(err) }