From b753f5f496be2fe94ca3da19cc14ed95b6ebbc0b Mon Sep 17 00:00:00 2001 From: peetzweg/ Date: Fri, 2 Feb 2024 16:59:49 +0100 Subject: [PATCH] use actual formState instead of self mantained state --- .../components/web3/greeter-contract-interactions.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/web3/greeter-contract-interactions.tsx b/frontend/src/components/web3/greeter-contract-interactions.tsx index 909ff91..4e7e05a 100644 --- a/frontend/src/components/web3/greeter-contract-interactions.tsx +++ b/frontend/src/components/web3/greeter-contract-interactions.tsx @@ -32,7 +32,6 @@ export const GreeterContractInteractions: FC = () => { const { typedContract } = useRegisteredTypedContract(ContractIds.Greeter, GreeterContract) const [greeterMessage, setGreeterMessage] = useState() const [fetchIsLoading, setFetchIsLoading] = useState() - const [updateIsLoading, setUpdateIsLoading] = useState() const form = useForm>({ resolver: zodResolver(formSchema), }) @@ -72,8 +71,6 @@ export const GreeterContractInteractions: FC = () => { return } - // Send transaction - setUpdateIsLoading(true) try { await contractTxWithToast(api, activeAccount.address, contract, 'setMessage', {}, [ newMessage, @@ -82,7 +79,6 @@ export const GreeterContractInteractions: FC = () => { } catch (e) { console.error(e) } finally { - setUpdateIsLoading(false) fetchGreeting() } } @@ -121,12 +117,12 @@ export const GreeterContractInteractions: FC = () => { Update Greeting
- +