diff options
Convert more actions to new simple pattern
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 2ffa352a4..d63d36f19 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -226,14 +226,7 @@ function createNewVaultAndRestore (password, seed) { } function createNewVaultAndKeychain (password) { - return (dispatch) => { - background.createNewVaultAndKeychain(password, (err, newState) => { - if (err) { - return dispatch(actions.displayWarning(err.message)) - } - dispatch(actions.updateMetamaskState(newState)) - }) - } + return callBackgroundThenUpdate(background.createNewVaultAndKeychain, password) } function revealSeedConfirmation () { @@ -255,17 +248,8 @@ function requestRevealSeed (password) { } } - function addNewKeyring (type, opts) { - return (dispatch) => { - dispatch(actions.showLoadingIndication()) - background.addNewKeyring(type, opts, (err) => { - dispatch(this.hideLoadingIndication()) - if (err) { - return dispatch(actions.displayWarning(err)) - } - }) - } + return callBackgroundThenUpdate(background.addNewKeyring, type, opts) } function addNewAccount (ringNumber = 0) { |