mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
use app.permissions.checkUserIdIsSelf
instead pass selfId
prop
This commit is contained in:
parent
e7fab7e013
commit
d16e7b5ba6
@ -11,7 +11,6 @@ import PostActions from "./components/actions"
|
||||
import "./index.less"
|
||||
|
||||
export default React.memo(({
|
||||
selfId,
|
||||
expansibleActions = window.app.settings.get("postCard_expansible_actions"),
|
||||
autoCarrousel = window.app.settings.get("postCard_carrusel_auto"),
|
||||
data = {},
|
||||
@ -100,11 +99,13 @@ export default React.memo(({
|
||||
}, [])
|
||||
|
||||
React.useEffect(() => {
|
||||
// check if the post has liked by you
|
||||
const hasLiked = likes.includes(selfId)
|
||||
const hasSaved = data.isSaved
|
||||
if (!app.userData) {
|
||||
return
|
||||
}
|
||||
|
||||
//console.log(`[${data._id}] CHECKING LIKE OF USER ${selfId} > ${hasLiked}`)
|
||||
// check if the post has liked by you
|
||||
const hasLiked = likes.includes(app.userData._id)
|
||||
const hasSaved = data.isSaved
|
||||
|
||||
setHasLiked(hasLiked)
|
||||
setHasSaved(hasSaved)
|
||||
@ -148,7 +149,7 @@ export default React.memo(({
|
||||
}
|
||||
{!fullmode &&
|
||||
<PostActions
|
||||
isSelf={selfId === data.user_id}
|
||||
isSelf={app.permissions.checkUserIdIsSelf(data.user_id)}
|
||||
defaultLiked={hasLiked}
|
||||
defaultSaved={hasSaved}
|
||||
onClickLike={onClickLike}
|
||||
|
Loading…
x
Reference in New Issue
Block a user