mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-27 12:56:01 +01:00
Add action for updating and approving a tx in one action
This commit is contained in:
parent
1eb4a5d62c
commit
d844769c92
@ -94,6 +94,7 @@ var actions = {
|
||||
cancelPersonalMsg,
|
||||
sendTx: sendTx,
|
||||
signTx: signTx,
|
||||
updateAndApproveTx,
|
||||
cancelTx: cancelTx,
|
||||
completedTx: completedTx,
|
||||
txError: txError,
|
||||
@ -415,6 +416,20 @@ function sendTx (txData) {
|
||||
}
|
||||
}
|
||||
|
||||
function updateAndApproveTx (txData) {
|
||||
log.info('actions: updateAndApproveTx')
|
||||
return (dispatch) => {
|
||||
log.debug(`actions calling background.updateAndApproveTx`)
|
||||
background.updateAndApproveTransaction(txData, (err) => {
|
||||
if (err) {
|
||||
dispatch(actions.txError(err))
|
||||
return console.error(err.message)
|
||||
}
|
||||
dispatch(actions.completedTx(txData.id))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function completedTx (id) {
|
||||
return {
|
||||
type: actions.COMPLETED_TX,
|
||||
|
Loading…
Reference in New Issue
Block a user