@@ -11,7 +11,7 @@ import {
1111import { THIRDWEB_ENGINE_CLOUD_URL } from "@/constants/env" ;
1212import { useThirdwebClient } from "@/constants/thirdweb.client" ;
1313import { zodResolver } from "@hookform/resolvers/zod" ;
14- import { useMutation } from "@tanstack/react-query" ;
14+ import { useMutation , useQueryClient } from "@tanstack/react-query" ;
1515import { ChevronDown , Loader2 , LockIcon } from "lucide-react" ;
1616import { useState } from "react" ;
1717import { useForm } from "react-hook-form" ;
@@ -33,10 +33,12 @@ type FormValues = z.infer<typeof formSchema>;
3333
3434export function SendTestTransaction ( props : {
3535 wallets ?: Wallet [ ] ;
36+ clientId : string ;
3637 expanded ?: boolean ;
3738} ) {
3839 const [ isOpen , setIsOpen ] = useState ( props . expanded ?? false ) ;
3940 const thirdwebClient = useThirdwebClient ( ) ;
41+ const queryClient = useQueryClient ( ) ;
4042
4143 const form = useForm < FormValues > ( {
4244 resolver : zodResolver ( formSchema ) ,
@@ -103,12 +105,15 @@ export function SendTestTransaction(props: {
103105 return null ;
104106 }
105107
106- const onSubmit = ( data : FormValues ) => {
107- sendDummyTxMutation . mutate ( {
108+ const onSubmit = async ( data : FormValues ) => {
109+ await sendDummyTxMutation . mutateAsync ( {
108110 walletAddress : selectedWallet . address ,
109111 accessToken : data . accessToken ,
110112 chainId : data . chainId ,
111113 } ) ;
114+ queryClient . invalidateQueries ( {
115+ queryKey : [ "transactions" , props . clientId ] ,
116+ } ) ;
112117 } ;
113118
114119 return (
0 commit comments