mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-10-22 11:22:43 +02:00
Transition to home view after tx error
This commit is contained in:
parent
27d030b1a1
commit
343a7e9cce
@ -97,7 +97,6 @@ var actions = {
|
|||||||
cancelMsg: cancelMsg,
|
cancelMsg: cancelMsg,
|
||||||
signPersonalMsg,
|
signPersonalMsg,
|
||||||
cancelPersonalMsg,
|
cancelPersonalMsg,
|
||||||
sendTx: sendTx,
|
|
||||||
signTx: signTx,
|
signTx: signTx,
|
||||||
updateAndApproveTx,
|
updateAndApproveTx,
|
||||||
cancelTx: cancelTx,
|
cancelTx: cancelTx,
|
||||||
@ -397,26 +396,13 @@ function signPersonalMsg (msgData) {
|
|||||||
|
|
||||||
function signTx (txData) {
|
function signTx (txData) {
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
|
dispatch(actions.showLoadingIndication())
|
||||||
global.ethQuery.sendTransaction(txData, (err, data) => {
|
global.ethQuery.sendTransaction(txData, (err, data) => {
|
||||||
dispatch(actions.hideLoadingIndication())
|
dispatch(actions.hideLoadingIndication())
|
||||||
if (err) return dispatch(actions.displayWarning(err.message))
|
if (err) dispatch(actions.displayWarning(err.message))
|
||||||
dispatch(actions.hideWarning())
|
dispatch(this.goHome())
|
||||||
})
|
|
||||||
dispatch(this.showConfTxPage())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function sendTx (txData) {
|
|
||||||
log.info(`actions - sendTx: ${JSON.stringify(txData.txParams)}`)
|
|
||||||
return (dispatch) => {
|
|
||||||
log.debug(`actions calling background.approveTransaction`)
|
|
||||||
background.approveTransaction(txData.id, (err) => {
|
|
||||||
if (err) {
|
|
||||||
dispatch(actions.txError(err))
|
|
||||||
return log.error(err.message)
|
|
||||||
}
|
|
||||||
dispatch(actions.completedTx(txData.id))
|
|
||||||
})
|
})
|
||||||
|
dispatch(actions.showConfTxPage())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -428,6 +414,7 @@ function updateAndApproveTx (txData) {
|
|||||||
dispatch(actions.hideLoadingIndication())
|
dispatch(actions.hideLoadingIndication())
|
||||||
if (err) {
|
if (err) {
|
||||||
dispatch(actions.txError(err))
|
dispatch(actions.txError(err))
|
||||||
|
dispatch(actions.goHome())
|
||||||
return log.error(err.message)
|
return log.error(err.message)
|
||||||
}
|
}
|
||||||
dispatch(actions.completedTx(txData.id))
|
dispatch(actions.completedTx(txData.id))
|
||||||
|
Loading…
Reference in New Issue
Block a user