aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-02-01 10:24:20 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-02-01 10:24:20 +0800
commit4f1fe1da6295902e3e0fee633444f84f61f28449 (patch)
treea8e35564ec7963c70cd61868323c202bdc7131dd /ui/app/actions.js
parent0c6fef3dec4f3ba70e8e86275ee9db4f2d58d129 (diff)
parent78bce55858916ba9d3189f76db440768e6ae95b1 (diff)
downloadtangerine-wallet-browser-4f1fe1da6295902e3e0fee633444f84f61f28449.tar.gz
tangerine-wallet-browser-4f1fe1da6295902e3e0fee633444f84f61f28449.tar.zst
tangerine-wallet-browser-4f1fe1da6295902e3e0fee633444f84f61f28449.zip
Fix merge conflicts from uat-next
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index da69b8195..e5b35daaa 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -55,6 +55,7 @@ var actions = {
SET_NEW_ACCOUNT_FORM: 'SET_NEW_ACCOUNT_FORM',
unlockMetamask: unlockMetamask,
unlockFailed: unlockFailed,
+ unlockSucceeded,
showCreateVault: showCreateVault,
showRestoreVault: showRestoreVault,
showInitializeMenu: showInitializeMenu,
@@ -78,6 +79,7 @@ var actions = {
// unlock screen
UNLOCK_IN_PROGRESS: 'UNLOCK_IN_PROGRESS',
UNLOCK_FAILED: 'UNLOCK_FAILED',
+ UNLOCK_SUCCEEDED: 'UNLOCK_SUCCEEDED',
UNLOCK_METAMASK: 'UNLOCK_METAMASK',
LOCK_METAMASK: 'LOCK_METAMASK',
tryUnlockMetamask: tryUnlockMetamask,
@@ -281,12 +283,14 @@ function tryUnlockMetamask (password) {
log.debug(`background.submitPassword`)
return new Promise((resolve, reject) => {
- background.submitPassword(password, err => {
+ background.submitPassword(password, (err) => {
dispatch(actions.hideLoadingIndication())
if (err) {
+ dispatch(actions.unlockFailed(err.message))
reject(err)
} else {
+ dispatch(actions.unlockSucceeded())
dispatch(actions.transitionForward())
return forceUpdateMetamaskState(dispatch).then(resolve)
}
@@ -967,6 +971,13 @@ function unlockFailed (message) {
}
}
+function unlockSucceeded (message) {
+ return {
+ type: actions.UNLOCK_SUCCEEDED,
+ value: message,
+ }
+}
+
function unlockMetamask (account) {
return {
type: actions.UNLOCK_METAMASK,