From 237a48f4168a9d73fc19678f38fff2dcf295764e Mon Sep 17 00:00:00 2001 From: ebedoise Date: Thu, 1 Aug 2024 15:11:01 +0200 Subject: [PATCH] check updated address --- apps/poll/src/Choices.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/poll/src/Choices.tsx b/apps/poll/src/Choices.tsx index 6a04a49f..4b1cae06 100644 --- a/apps/poll/src/Choices.tsx +++ b/apps/poll/src/Choices.tsx @@ -38,6 +38,7 @@ export const Choices = () => { const [currentAddress, setCurrentAddress] = useState>(address ?? null); useEffect(() => { + console.log('Address from useAccount:', address); setCurrentAddress(address ?? null); }, [address]); @@ -48,7 +49,6 @@ export const Choices = () => { if (!data || !data.poll) return <>Error; const alreadyVoted = haveAlreadyVote(data.poll.voters, currentAddress ?? undefined); - const handleClickOnChoice = (choice: ChoiceType) => { setChoice(choice); onOpen(); @@ -56,7 +56,7 @@ export const Choices = () => { const handleVote = async (choiceId: string) => { console.log('alreadyVoted: ', alreadyVoted); - console.log('address: ', currentAddress); + console.log('currentAddress: ', currentAddress); if (alreadyVoted) { toast({ title: 'You have already voted',