Derive shadow like count (#2616)

This commit is contained in:
dan 2024-01-25 21:21:07 +00:00 committed by GitHub
parent a588b0d548
commit 3b26b32f7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 27 additions and 31 deletions

View file

@ -73,20 +73,17 @@ let PostCtrls = ({
postLikeMutation.mutate({
uri: post.uri,
cid: post.cid,
likeCount: post.likeCount || 0,
})
} else {
postUnlikeMutation.mutate({
postUri: post.uri,
likeUri: post.viewer.like,
likeCount: post.likeCount || 0,
})
}
}, [
post.viewer?.like,
post.uri,
post.cid,
post.likeCount,
postLikeMutation,
postUnlikeMutation,
])
@ -98,20 +95,17 @@ let PostCtrls = ({
postRepostMutation.mutate({
uri: post.uri,
cid: post.cid,
repostCount: post.repostCount || 0,
})
} else {
postUnrepostMutation.mutate({
postUri: post.uri,
repostUri: post.viewer.repost,
repostCount: post.repostCount || 0,
})
}
}, [
post.uri,
post.cid,
post.viewer?.repost,
post.repostCount,
closeModal,
postRepostMutation,
postUnrepostMutation,