From 4e7462eda39d0efae4fbd9f1f36cb8babde113cb Mon Sep 17 00:00:00 2001 From: ~latter-bolden Date: Fri, 10 Jan 2025 15:40:35 -0500 Subject: [PATCH] move useEffect above conditional return --- packages/ui/src/components/InviteFriendsToTlonButton.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/ui/src/components/InviteFriendsToTlonButton.tsx b/packages/ui/src/components/InviteFriendsToTlonButton.tsx index a97ae2a91d..6235d83acf 100644 --- a/packages/ui/src/components/InviteFriendsToTlonButton.tsx +++ b/packages/ui/src/components/InviteFriendsToTlonButton.tsx @@ -30,6 +30,10 @@ export function InviteFriendsToTlonButton({ const title = useGroupTitle(group); const { doCopy } = useCopy(shareUrl || ''); + useEffect(() => { + logger.trackEvent('Invite Button Shown', { group: group?.id }); + }, []); + const handleInviteButtonPress = useCallback(async () => { if (shareUrl && status === 'ready' && group) { if (isWeb) { @@ -106,11 +110,6 @@ export function InviteFriendsToTlonButton({ const linkFailed = linkIsDisabled || status === 'error' || status === 'unsupported'; - useEffect(() => { - // eslint-disable-next-line - logger.trackEvent('Invite Button Shown', { group: group?.id }); - }, []); - return (