From 43d19a319bd92f6fa12c1c70b1961fd782bf0bf9 Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Wed, 13 Mar 2024 00:00:30 +0700 Subject: [PATCH] Hide post preview from grill admin --- src/components/posts/view-post/PostPreview.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/posts/view-post/PostPreview.tsx b/src/components/posts/view-post/PostPreview.tsx index 91e71b2e4..659c9ad8b 100644 --- a/src/components/posts/view-post/PostPreview.tsx +++ b/src/components/posts/view-post/PostPreview.tsx @@ -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 { @@ -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