Skip to content

Commit

Permalink
follow之后按钮消失
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuaige1234567 committed Dec 14, 2023
1 parent 7f0cce9 commit 4eee957
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions frontend/src/routes/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,15 @@ export default function UserProfile() {
}
}, [userid])

useEffect(() => {

me && principal && userApi.isFollowed(me, principal).then(e => {
const isFollow = async () => {
if (me && principal) {
const e = await userApi.isFollowed(me, principal)
setIsFollowed(e)
})
}
}

useEffect(() => {
isFollow()
}, [me, principal])


Expand Down Expand Up @@ -125,6 +129,7 @@ export default function UserProfile() {
icon: <LoadingOutlined/>
})
await userApi.follow(principal);
await isFollow()
api.success({
message: 'Follow Successful !',
key: 'follow',
Expand Down

0 comments on commit 4eee957

Please sign in to comment.