* feat: Add editing * feat: Add comment badges * fix: make loading more consistent * misc: remove prop drilling * feat: Add post editing * misc: update version * feat: Add comment deletion
9 lines
369 B
TypeScript
9 lines
369 B
TypeScript
import type { CommentView, PersonView, PostView } from 'lemmy-js-client'
|
|
|
|
export const isMutable = (post: PostView, me: PersonView) =>
|
|
(me.person.admin && post.post.local) || me.person.id == post.creator.id
|
|
|
|
export const isCommentMutable = (comment: CommentView, me: PersonView) =>
|
|
(me.person.admin && comment.comment.local) ||
|
|
me.person.id == comment.creator.id
|