Skip to content

Commit

Permalink
fix: error handling for null swap in pay
Browse files Browse the repository at this point in the history
Right now, invalid config is being thrown when
a swap that is not in the history is being accessed
  • Loading branch information
michael1011 committed Mar 19, 2024
1 parent e0eacf6 commit b15db2a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/pages/Pay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ const Pay = () => {
});

createEffect(() => {
if (swap() === null) {
return;
}

const tx = swapStatusTransaction();

if (swap().asset === RBTC && tx && swap().claimTx === undefined) {
Expand All @@ -69,6 +73,10 @@ const Pay = () => {
});

createEffect(() => {
if (swap() === null) {
return;
}

const claimTx = swap().claimTx;

if (swap().asset === RBTC && claimTx) {
Expand All @@ -78,6 +86,10 @@ const Pay = () => {
});

createEffect(() => {
if (swap() === null) {
return;
}

const lockupTx = swap().lockupTx;

if (swap().asset === RBTC && lockupTx) {
Expand Down

0 comments on commit b15db2a

Please sign in to comment.