Skip to content

Commit

Permalink
Force nonce refetch after approve (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
everdimension authored Dec 27, 2024
1 parent 73fb3e5 commit a5d835a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ui/pages/SwapForm/SwapForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export function SwapFormComponent() {
? approvalTransaction
: swapTransaction;

const { data: networkNonce } = useQuery({
const { data: networkNonce, refetch: refetchNonce } = useQuery({
suspense: false,
queryKey: ['uiGetBestKnownTransactionCount', address, chain, networks],
queryFn: async () => {
Expand Down Expand Up @@ -428,12 +428,14 @@ export function SwapFormComponent() {
if (approveTxStatus === 'confirmed') {
refetchAllowanceQuery();
refetchQuotes();
refetchNonce();
} else if (approveTxStatus === 'failed' || approveTxStatus === 'dropped') {
resetApproveMutation();
}
}, [
approveTxStatus,
refetchAllowanceQuery,
refetchNonce,
refetchQuotes,
resetApproveMutation,
]);
Expand Down

0 comments on commit a5d835a

Please sign in to comment.