From 8fde8a8921135112ccfdd13ce6b009755b5f71ed Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 21 Jun 2016 13:56:04 -0700 Subject: Manually linted --- ui/app/actions.js | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'ui/app/actions.js') diff --git a/ui/app/actions.js b/ui/app/actions.js index 5ceae6b6c..0cbc3b9e6 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -139,12 +139,6 @@ function closeMenu () { } } -function getNetworkStatus () { - return { - type: actions.getNetworkStatus, - } -} - // async actions function tryUnlockMetamask (password) { @@ -164,6 +158,9 @@ function createNewVault (password, entropy) { return (dispatch) => { dispatch(actions.createNewVaultInProgress()) _accountManager.createNewVault(password, entropy, (err, result) => { + if (err) { + return dispatch(actions.showWarning(err.message)) + } dispatch(actions.showNewVaultSeed(result)) }) } @@ -318,6 +315,10 @@ function agreeToDisclaimer () { return (dispatch) => { dispatch(this.showLoadingIndication()) _accountManager.agreeToDisclaimer((err) => { + if (err) { + return dispatch(actions.showWarning(err.message)) + } + dispatch(this.hideLoadingIndication()) dispatch({ type: this.AGREE_TO_DISCLAIMER, @@ -372,10 +373,14 @@ function updateMetamaskState (newState) { function lockMetamask () { return (dispatch) => { _accountManager.setLocked((err) => { + dispatch(actions.hideLoadingIndication()) + if (err) { + return dispatch(actions.showWarning(err.message)) + } + dispatch({ type: actions.LOCK_METAMASK, }) - dispatch(actions.hideLoadingIndication()) }) } } @@ -385,6 +390,10 @@ function showAccountDetail (address) { dispatch(actions.showLoadingIndication()) _accountManager.setSelectedAddress(address, (err, address) => { dispatch(actions.hideLoadingIndication()) + if (err) { + return dispatch(actions.showWarning(err.message)) + } + dispatch({ type: actions.SHOW_ACCOUNT_DETAIL, value: address, @@ -410,6 +419,11 @@ function confirmSeedWords () { return (dispatch) => { dispatch(actions.showLoadingIndication()) _accountManager.clearSeedWordCache((err, account) => { + dispatch(actions.hideLoadingIndication()) + if (err) { + return dispatch(actions.showWarning(err.message)) + } + console.log('Seed word cache cleared. ' + account) dispatch(actions.showAccountDetail(account)) }) -- cgit v1.2.3