From 66da58741cffc85862be7dd9fce4a2baeccc3aef Mon Sep 17 00:00:00 2001 From: Mathieu Geukens Date: Tue, 17 Sep 2024 15:05:07 +0200 Subject: [PATCH] fix bug useEffect dependencyArray --- src/components/ContractFunction.tsx | 2 +- src/components/TransactionBuilder.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ContractFunction.tsx b/src/components/ContractFunction.tsx index d620d2c..bd96c55 100644 --- a/src/components/ContractFunction.tsx +++ b/src/components/ContractFunction.tsx @@ -48,7 +48,7 @@ const ContractFunction: React.FC = ({ contractInfo, abi, provider, wallet setNamedUtxoList(newNamedUtxoList); } updateUtxos() - }, [contractInfo]) + }, [contractInfo, wallets]) function fillPrivKey(i: number, walletIndex: string) { const argsCopy = [...functionArgs]; diff --git a/src/components/TransactionBuilder.tsx b/src/components/TransactionBuilder.tsx index 6c23599..7df03f1 100644 --- a/src/components/TransactionBuilder.tsx +++ b/src/components/TransactionBuilder.tsx @@ -20,7 +20,7 @@ const TransactionBuilder: React.FC = ({ provider, wallets, contracts, upd const contractName = selectedContract?.contract.name const updatedContract = contracts?.find(contractInfo => contractInfo.contract?.name === contractName) if(updatedContract != selectedContract) setSelectedContract(updatedContract) - }, [contracts]) + }, [contracts, wallets]) const contractSelector = (