Skip to content

Commit

Permalink
chore: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisduma-ledger committed Sep 3, 2024
1 parent 817f7e2 commit 5e53bdc
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ const Body = ({ data, onClose }: { data: Data; onClose?: () => void | undefined
};
};

const handleTransactionResult = (result: ResultsState, operation: Operation) => {
setResult(result);

onResult(operation);
};

const handleSwapTransaction = (operation: Operation, result: ResultsState) => {
const newResult = {
operation,
Expand All @@ -183,15 +189,11 @@ const Body = ({ data, onClose }: { data: Data; onClose?: () => void | undefined
magnitudeAwareRate: magnitudeAwareRate as BigNumber,
});

setResult(result);

onResult(operation);
handleTransactionResult(result, operation);
};

const handleSellTransaction = (operation: Operation, result: ResultsState) => {
setResult(result);

onResult(operation);
handleTransactionResult(result, operation);
};

const onBroadcastSuccess = useCallback(
Expand Down

0 comments on commit 5e53bdc

Please sign in to comment.