Files
photon-tbw/src/lib/components/lemmy/post/helpers.ts
T
Xylight 7b1ad247f9 feat: Add post and comment editing (#12)
* 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
2023-07-25 11:12:15 -07:00

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