aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorbrunobar79 <brunobar79@gmail.com>2018-07-11 12:20:40 +0800
committerbrunobar79 <brunobar79@gmail.com>2018-07-11 12:20:40 +0800
commit523cf9ad33d88719520ae5e7293329d133b64d4d (patch)
treed547846aa4938afbd90d242548f89f11200fe1b6 /ui/app/actions.js
parentb9c2994d24e688305d63aaefd7fac88d88773ad9 (diff)
downloadtangerine-wallet-browser-523cf9ad33d88719520ae5e7293329d133b64d4d.tar.gz
tangerine-wallet-browser-523cf9ad33d88719520ae5e7293329d133b64d4d.tar.zst
tangerine-wallet-browser-523cf9ad33d88719520ae5e7293329d133b64d4d.zip
account removal is working
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index f04de8fe8..3bdd548d3 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -83,6 +83,7 @@ var actions = {
NEW_ACCOUNT_SCREEN: 'NEW_ACCOUNT_SCREEN',
navigateToNewAccountScreen,
resetAccount,
+ removeAccount,
showNewVaultSeed: showNewVaultSeed,
showInfoPage: showInfoPage,
CLOSE_WELCOME_SCREEN: 'CLOSE_WELCOME_SCREEN',
@@ -535,6 +536,26 @@ function resetAccount () {
}
}
+function removeAccount (address) {
+ return dispatch => {
+ dispatch(actions.showLoadingIndication())
+
+ return new Promise((resolve, reject) => {
+ background.removeAccount(address, (err, account) => {
+ dispatch(actions.hideLoadingIndication())
+ if (err) {
+ dispatch(actions.displayWarning(err.message))
+ return reject(err)
+ }
+
+ log.info('Account removed: ' + account)
+ dispatch(actions.showAccountsPage())
+ resolve()
+ })
+ })
+ }
+}
+
function addNewKeyring (type, opts) {
return (dispatch) => {
dispatch(actions.showLoadingIndication())