Skip to content

Commit

Permalink
fix: Don't show swaps as 'refundable' when there was no lockup tx
Browse files Browse the repository at this point in the history
  • Loading branch information
kiocosta committed Feb 3, 2025
1 parent cf96270 commit ff38c44
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/pages/Refund.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ const Refund = () => {
const swapsToRefund = (await getSwaps())
.filter(refundSwapsSanityFilter)
.filter((swap) =>
[
swapStatusFailed.InvoiceFailedToPay,
swapStatusFailed.TransactionLockupFailed,
].includes(swap.status),
[swapStatusFailed.TransactionLockupFailed].includes(
swap.status,
),
);
setRefundableSwaps(swapsToRefund);

Expand All @@ -53,12 +52,7 @@ const Refund = () => {
!(await updateSwapStatus(swap.id, res.status)) &&
Object.values(swapStatusFailed).includes(res.status)
) {
if (res.status !== swapStatusFailed.SwapExpired) {
addToRefundableSwaps(swap);
return;
}

// Make sure coins were locked for the swap with the status "swap.expired"
// Make sure coins were locked for the swaps with status "swap.expired" or "swap.failedToPay"
await getLockupTransaction(swap.id, swap.type);
addToRefundableSwaps(swap);
}
Expand Down

0 comments on commit ff38c44

Please sign in to comment.