Skip to content

Commit

Permalink
Hide post preview from grill admin
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Mar 12, 2024
1 parent a8fd2d7 commit 43d19a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/posts/view-post/PostPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export type PreviewProps = BarePreviewProps & {
showPinnedIcon?: boolean
}

// grill admin account
const HIDE_PREVIEW_FROM_ACCOUNT = ['3rPYmfYVHG7NtuGDivDNZdMMRHgrwtVuswY9TWUaHQCU8tAo']
export function PostPreview(props: PreviewProps) {
const { postDetails, space: externalSpace, showPinnedIcon } = props
const {
Expand All @@ -35,8 +37,9 @@ export function PostPreview(props: PreviewProps) {
const { isSharedPost } = post
const space = externalSpace || globalSpace
const isUnlisted = useIsUnlistedPost({ post, space: space?.struct })
const isHiddenPreview = HIDE_PREVIEW_FROM_ACCOUNT.includes(post.ownerId)

if (isUnlisted) return null
if (isUnlisted || isHiddenPreview) return null

const postContent = postDetails.post.content
const isEmptyContent = !isSharedPost && !postContent?.title && !postContent?.body
Expand Down

0 comments on commit 43d19a3

Please sign in to comment.