From e6fda855a556a6aa0325556b074612ff76925e5d Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Wed, 31 Jan 2018 03:33:15 -0500 Subject: added reset account feature --- ui/app/actions.js | 16 ++++++++++++++++ ui/app/config.js | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+) (limited to 'ui') diff --git a/ui/app/actions.js b/ui/app/actions.js index 52ea899aa..90acdc821 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -47,12 +47,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', @@ -308,6 +310,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()) diff --git a/ui/app/config.js b/ui/app/config.js index 9cb2a0aad..9b9cac4bf 100644 --- a/ui/app/config.js +++ b/ui/app/config.js @@ -55,6 +55,7 @@ ConfigScreen.prototype.render = function () { h('.flex-space-around', { style: { padding: '20px', + overflow: 'auto', }, }, [ @@ -142,6 +143,24 @@ ConfigScreen.prototype.render = function () { }, 'Reveal Seed Words'), ]), + h('hr.horizontal-line'), + + h('div', { + style: { + marginTop: '20px', + }, + }, [ + h('button', { + style: { + alignSelf: 'center', + }, + onClick (event) { + event.preventDefault() + state.dispatch(actions.resetAccount()) + }, + }, 'Reset Account'), + ]), + ]), ]), ]) -- cgit