1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Convert more actions to new simple pattern

This commit is contained in:
Dan Finlay 2017-01-03 11:33:15 -08:00
parent 10c818abac
commit 2c2cdc4475

View File

@ -226,14 +226,7 @@ function createNewVaultAndRestore (password, seed) {
} }
function createNewVaultAndKeychain (password) { function createNewVaultAndKeychain (password) {
return (dispatch) => { return callBackgroundThenUpdate(background.createNewVaultAndKeychain, password)
background.createNewVaultAndKeychain(password, (err, newState) => {
if (err) {
return dispatch(actions.displayWarning(err.message))
}
dispatch(actions.updateMetamaskState(newState))
})
}
} }
function revealSeedConfirmation () { function revealSeedConfirmation () {
@ -255,17 +248,8 @@ function requestRevealSeed (password) {
} }
} }
function addNewKeyring (type, opts) { function addNewKeyring (type, opts) {
return (dispatch) => { return callBackgroundThenUpdate(background.addNewKeyring, type, opts)
dispatch(actions.showLoadingIndication())
background.addNewKeyring(type, opts, (err) => {
dispatch(this.hideLoadingIndication())
if (err) {
return dispatch(actions.displayWarning(err))
}
})
}
} }
function addNewAccount (ringNumber = 0) { function addNewAccount (ringNumber = 0) {