fix: allow cancelation of batched transactions

This commit is contained in:
Sérgio Salgado 2023-06-05 20:44:53 +01:00
parent 595e215dd5
commit 63853f116c
3 changed files with 6 additions and 3 deletions

View file

@ -223,7 +223,8 @@ function cancel (txId) {
const updateRec = { const updateRec = {
error: 'Operator cancel', error: 'Operator cancel',
error_code: 'operatorCancel', error_code: 'operatorCancel',
operator_completed: true operator_completed: true,
batch_id: null
} }
return Promise.resolve() return Promise.resolve()

View file

@ -6,7 +6,8 @@ const wallet = require('./wallet')
function submitBatch (settings, batch) { function submitBatch (settings, batch) {
txBatching.getBatchTransactions(batch) txBatching.getBatchTransactions(batch)
.then(txs => { .then(txs => {
wallet.sendCoinsBatch(settings, txs, batch.crypto_code) if (_.isEmpty(txs)) return Promise.resolve()
return wallet.sendCoinsBatch(settings, txs, batch.crypto_code)
.then(res => txBatching.confirmSentBatch(batch, res)) .then(res => txBatching.confirmSentBatch(batch, res))
.catch(err => txBatching.setErroredBatch(batch, err.message)) .catch(err => txBatching.setErroredBatch(batch, err.message))
}) })

View file

@ -383,7 +383,8 @@ const DetailsRow = ({ it: tx, timezone }) => {
) : ( ) : (
errorElements errorElements
)} )}
{tx.txClass === 'cashOut' && getStatus(tx) === 'Pending' && ( {((tx.txClass === 'cashOut' && getStatus(tx) === 'Pending') ||
(tx.txClass === 'cashIn' && getStatus(tx) === 'Batched')) && (
<ActionButton <ActionButton
color="primary" color="primary"
Icon={CancelIcon} Icon={CancelIcon}