aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorDan J Miller <danjm.com@gmail.com>2018-02-14 03:01:49 +0800
committerGitHub <noreply@github.com>2018-02-14 03:01:49 +0800
commitb4bfdc5e6c5e239397d2447dd9bb5d4ba744abba (patch)
tree16917a2467eb28d2fc24212d0ad1416480b716a5 /ui/app/actions.js
parentc50a197ab95b462b4416cbf85139f80db9b70f0c (diff)
parentee1197192f2f539d5e63c8d65f77a5cd94bbd7df (diff)
downloadtangerine-wallet-browser-b4bfdc5e6c5e239397d2447dd9bb5d4ba744abba.tar.gz
tangerine-wallet-browser-b4bfdc5e6c5e239397d2447dd9bb5d4ba744abba.tar.zst
tangerine-wallet-browser-b4bfdc5e6c5e239397d2447dd9bb5d4ba744abba.zip
Merge pull request #3239 from MetaMask/uat-next
Uat next
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 977458023..c6776eeee 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -47,6 +47,8 @@ var actions = {
SHOW_RESTORE_VAULT: 'SHOW_RESTORE_VAULT',
FORGOT_PASSWORD: 'FORGOT_PASSWORD',
forgotPassword: forgotPassword,
+ markPasswordForgotten,
+ unMarkPasswordForgotten,
SHOW_INIT_MENU: 'SHOW_INIT_MENU',
SHOW_NEW_VAULT_SEED: 'SHOW_NEW_VAULT_SEED',
SHOW_INFO_PAGE: 'SHOW_INFO_PAGE',
@@ -55,6 +57,7 @@ var actions = {
SET_NEW_ACCOUNT_FORM: 'SET_NEW_ACCOUNT_FORM',
unlockMetamask: unlockMetamask,
unlockFailed: unlockFailed,
+ unlockSucceeded,
showCreateVault: showCreateVault,
showRestoreVault: showRestoreVault,
showInitializeMenu: showInitializeMenu,
@@ -80,6 +83,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,
@@ -253,6 +257,9 @@ var actions = {
updateFeatureFlags,
UPDATE_FEATURE_FLAGS: 'UPDATE_FEATURE_FLAGS',
+ setMouseUserState,
+ SET_MOUSE_USER_STATE: 'SET_MOUSE_USER_STATE',
+
// Network
setNetworkEndpoints,
updateNetworkEndpointType,
@@ -286,6 +293,7 @@ function tryUnlockMetamask (password) {
if (err) {
dispatch(actions.unlockFailed(err.message))
} else {
+ dispatch(actions.unlockSucceeded())
dispatch(actions.transitionForward())
forceUpdateMetamaskState(dispatch)
}
@@ -832,6 +840,28 @@ function showRestoreVault () {
}
}
+function markPasswordForgotten () {
+ return (dispatch) => {
+ dispatch(actions.showLoadingIndication())
+ return background.markPasswordForgotten(() => {
+ dispatch(actions.hideLoadingIndication())
+ dispatch(actions.forgotPassword())
+ forceUpdateMetamaskState(dispatch)
+ })
+ }
+}
+
+function unMarkPasswordForgotten () {
+ return (dispatch) => {
+ dispatch(actions.showLoadingIndication())
+ return background.unMarkPasswordForgotten(() => {
+ dispatch(actions.hideLoadingIndication())
+ dispatch(actions.forgotPassword())
+ forceUpdateMetamaskState(dispatch)
+ })
+ }
+}
+
function forgotPassword () {
return {
type: actions.FORGOT_PASSWORD,
@@ -906,6 +936,13 @@ function unlockFailed (message) {
}
}
+function unlockSucceeded (message) {
+ return {
+ type: actions.UNLOCK_SUCCEEDED,
+ value: message,
+ }
+}
+
function unlockMetamask (account) {
return {
type: actions.UNLOCK_METAMASK,
@@ -1627,6 +1664,13 @@ function updateFeatureFlags (updatedFeatureFlags) {
}
}
+function setMouseUserState (isMouseUser) {
+ return {
+ type: actions.SET_MOUSE_USER_STATE,
+ value: isMouseUser,
+ }
+}
+
// Call Background Then Update
//
// A function generator for a common pattern wherein: