Skip to content

Commit

Permalink
Invalidate cache on successful transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
bpierre committed Oct 30, 2024
1 parent 3b538c4 commit d84c23b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/app/src/services/TransactionFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ export function TransactionFlow({ children }: { children: ReactNode }) {

const totalSteps = flow?.steps?.length ?? 0;

const queryClient = useQueryClient();

// handle transaction receipt
useEffect(() => {
if (txReceipt.status !== "pending") {
Expand Down Expand Up @@ -492,12 +494,14 @@ export function TransactionFlow({ children }: { children: ReactNode }) {
) ?? null,
txStatus: "confirmed",
});
queryClient.invalidateQueries();
return;
}
}, [
contractWrite,
currentStepIndex,
declaration,
queryClient,
totalSteps,
txReceipt,
updateStep,
Expand Down

0 comments on commit d84c23b

Please sign in to comment.