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) {
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) {