From 006b90fbe47b6c8aacc0f1b447f66831723dc802 Mon Sep 17 00:00:00 2001 From: Faye Date: Fri, 23 Aug 2024 18:11:32 +0200 Subject: [PATCH] fix client error --- .../community/[communityId]/page.client.tsx | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/src/app/[locale]/(main)/community/[communityId]/page.client.tsx b/src/app/[locale]/(main)/community/[communityId]/page.client.tsx index 2683661c..96e077c6 100644 --- a/src/app/[locale]/(main)/community/[communityId]/page.client.tsx +++ b/src/app/[locale]/(main)/community/[communityId]/page.client.tsx @@ -12,30 +12,6 @@ export function FollowerButton({ displayName, communityId }) { const [isFollowingState, setIsFollowingState] = useState(false) const [userId, setUserId] = useState(null) - useEffect(() => { - const getUserId = async () => { - try { - const data = await account.get() - setUserId(data?.$id) - } catch (error) { - setUserId(null) - } - } - getUserId().then() - }, []) - - useEffect(() => { - const isFollowing = async () => { - const data = await getIsFollowingCommunity(userId, communityId) - if (data.documents.length > 0) { - setIsFollowingState(true) - } - } - if (userId) { - isFollowing().then() - } - }, [communityId, userId]) - const handleFollow = async () => { const data = await addFollow(userId, communityId) if (data.code === 401) {