walet-core: always show refresh transactions when in an error state

This commit is contained in:
Florian Dold 2023-02-14 13:38:12 +01:00
parent 12fc0b3f2a
commit 58c59a3e5e
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -971,16 +971,25 @@ export async function getTransactions(
transactions.push(buildTransactionForPullPaymentDebit(pi)); transactions.push(buildTransactionForPullPaymentDebit(pi));
}); });
if (transactionsRequest?.includeRefreshes) {
tx.refreshGroups.iter().forEachAsync(async (rg) => { tx.refreshGroups.iter().forEachAsync(async (rg) => {
if (shouldSkipCurrency(transactionsRequest, rg.currency)) { if (shouldSkipCurrency(transactionsRequest, rg.currency)) {
return; return;
} }
let required = false;
const opId = RetryTags.forRefresh(rg); const opId = RetryTags.forRefresh(rg);
if (transactionsRequest?.includeRefreshes) {
required = true;
} else if (rg.operationStatus !== RefreshOperationStatus.Finished) {
const ort = await tx.operationRetries.get(opId);
if (ort) {
required = true;
}
}
if (required) {
const ort = await tx.operationRetries.get(opId); const ort = await tx.operationRetries.get(opId);
transactions.push(buildTransactionForRefresh(rg, ort)); transactions.push(buildTransactionForRefresh(rg, ort));
});
} }
});
tx.withdrawalGroups.iter().forEachAsync(async (wsr) => { tx.withdrawalGroups.iter().forEachAsync(async (wsr) => {
if ( if (