Skip to content

Commit

Permalink
fix client error
Browse files Browse the repository at this point in the history
  • Loading branch information
docimin committed Aug 23, 2024
1 parent 39e92be commit 006b90f
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/app/[locale]/(main)/community/[communityId]/page.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,6 @@ export function FollowerButton({ displayName, communityId }) {
const [isFollowingState, setIsFollowingState] = useState(false)
const [userId, setUserId] = useState(null)

Check warning on line 13 in src/app/[locale]/(main)/community/[communityId]/page.client.tsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused local symbol

Unused constant setUserId

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) {
Expand Down

0 comments on commit 006b90f

Please sign in to comment.