diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-02-09 06:16:58 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-02-09 08:43:31 +0800 |
commit | eb919f4710b37d09c9a3a68ed4c719e487cce9d9 (patch) | |
tree | 30e0c843a692ac10c637467b525f9bef0c795f48 /ui/app/actions.js | |
parent | 2fd9e58e612e9fe341c9107a677238a566e3c1b8 (diff) | |
parent | f39222c9afd9dcab4c6234940eb9a9cb06dbc6f0 (diff) | |
download | tangerine-wallet-browser-eb919f4710b37d09c9a3a68ed4c719e487cce9d9.tar tangerine-wallet-browser-eb919f4710b37d09c9a3a68ed4c719e487cce9d9.tar.gz tangerine-wallet-browser-eb919f4710b37d09c9a3a68ed4c719e487cce9d9.tar.bz2 tangerine-wallet-browser-eb919f4710b37d09c9a3a68ed4c719e487cce9d9.tar.lz tangerine-wallet-browser-eb919f4710b37d09c9a3a68ed4c719e487cce9d9.tar.xz tangerine-wallet-browser-eb919f4710b37d09c9a3a68ed4c719e487cce9d9.tar.zst tangerine-wallet-browser-eb919f4710b37d09c9a3a68ed4c719e487cce9d9.zip |
Merge branch 'uat-next' of https://github.com/MetaMask/metamask-extension into cb-254
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index e5b35daaa..138479ca4 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', @@ -70,12 +72,14 @@ var actions = { addNewAccount, NEW_ACCOUNT_SCREEN: 'NEW_ACCOUNT_SCREEN', navigateToNewAccountScreen, + resetAccount, showNewVaultSeed: showNewVaultSeed, showInfoPage: showInfoPage, // seed recovery actions REVEAL_SEED_CONFIRMATION: 'REVEAL_SEED_CONFIRMATION', revealSeedConfirmation: revealSeedConfirmation, requestRevealSeed: requestRevealSeed, + // unlock screen UNLOCK_IN_PROGRESS: 'UNLOCK_IN_PROGRESS', UNLOCK_FAILED: 'UNLOCK_FAILED', @@ -404,6 +408,20 @@ function requestRevealSeed (password) { } } +function resetAccount () { + return (dispatch) => { + background.resetAccount((err, account) => { + dispatch(actions.hideLoadingIndication()) + if (err) { + dispatch(actions.displayWarning(err.message)) + } + + log.info('Transaction history reset for ' + account) + dispatch(actions.showAccountsPage()) + }) + } +} + function addNewKeyring (type, opts) { return (dispatch) => { dispatch(actions.showLoadingIndication()) @@ -897,6 +915,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, |