diff options
Canceled, edited transactions show edited amount.
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index e694152a2..9d3d7184e 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -126,6 +126,7 @@ var actions = { signTx: signTx, signTokenTx: signTokenTx, updateAndApproveTx, + updateAndCancelTx, cancelTx: cancelTx, completedTx: completedTx, txError: txError, @@ -710,6 +711,24 @@ function updateAndApproveTx (txData) { } } +function updateAndCancelTx (txData) { + log.info('actions: updateAndCancelTx: ' + JSON.stringify(txData)) + return (dispatch) => { + log.debug(`actions calling background.updateAndCancelTx`) + background.updateAndCancelTransaction(txData, (err) => { + dispatch(actions.hideLoadingIndication()) + dispatch(actions.updateTransactionParams(txData.id, txData.txParams)) + dispatch(actions.clearSend()) + if (err) { + dispatch(actions.txError(err)) + dispatch(actions.goHome()) + return log.error(err.message) + } + dispatch(actions.completedTx(txData.id)) + }) + } +} + function completedTx (id) { return { type: actions.COMPLETED_TX, |