Skip to content

Commit

Permalink
move useEffect above conditional return
Browse files Browse the repository at this point in the history
  • Loading branch information
latter-bolden committed Jan 10, 2025
1 parent da35a9c commit 4e7462e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/ui/src/components/InviteFriendsToTlonButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 (
<Button
secondary
Expand Down

0 comments on commit 4e7462e

Please sign in to comment.