feat(posts): add purge UI feedback for mods

Show Purged author/ID, red content message, and file-deleted media when
post.commentModeration.purged is true. Mirrors removal UI pattern.
This commit is contained in:
plebeius
2026-03-06 21:44:33 +08:00
parent c69c46442b
commit ae744d0f78
40 changed files with 163 additions and 54 deletions
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "رابط للملف",
"support_5chan": "دعم 5chan",
"images": "صور",
"load_more": "تحميل المزيد"
"load_more": "تحميل المزيد",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "ফাইলের লিংক",
"support_5chan": "5chan সমর্থন করুন",
"images": "ছবি",
"load_more": "আরও লোড করুন"
"load_more": "আরও লোড করুন",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Odkaz na soubor",
"support_5chan": "Podpořte 5chan",
"images": "obrázky",
"load_more": "Načíst více"
"load_more": "Načíst více",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Link til fil",
"support_5chan": "Støt 5chan",
"images": "billeder",
"load_more": "Indlæs mere"
"load_more": "Indlæs mere",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Link zur Datei",
"support_5chan": "5chan unterstützen",
"images": "Bilder",
"load_more": "Mehr laden"
"load_more": "Mehr laden",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Σύνδεσμος προς αρχείο",
"support_5chan": "Υποστηρίξτε το 5chan",
"images": "εικόνες",
"load_more": "Φόρτωση περισσότερων"
"load_more": "Φόρτωση περισσότερων",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+2
View File
@@ -228,6 +228,8 @@
"bitsocial_account": "Bitsocial Account",
"purge": "purge",
"purge_confirm": "Purging permanently removes this content and all its replies from the database. Continue?",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible.",
"mod_queue": "Mod Queue",
"moderation_queue": "Moderation Queue",
"queue_is_empty": "Queue is empty",
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Enlace al archivo",
"support_5chan": "Apoyar 5chan",
"images": "imágenes",
"load_more": "Cargar más"
"load_more": "Cargar más",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "لینک به فایل",
"support_5chan": "از 5chan پشتیبانی کنید",
"images": "تصاویر",
"load_more": "بارگذاری بیشتر"
"load_more": "بارگذاری بیشتر",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Linkki tiedostoon",
"support_5chan": "Tue 5chan",
"images": "kuvat",
"load_more": "Lataa lisää"
"load_more": "Lataa lisää",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Link sa File",
"support_5chan": "Suportahan ang 5chan",
"images": "mga larawan",
"load_more": "Mag-load ng higit pa"
"load_more": "Mag-load ng higit pa",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Lien vers le fichier",
"support_5chan": "Soutenir 5chan",
"images": "images",
"load_more": "Charger plus"
"load_more": "Charger plus",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "קישור לקובץ",
"support_5chan": "תמוך ב-5chan",
"images": "תמונות",
"load_more": "טען עוד"
"load_more": "טען עוד",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "फ़ाइल का लिंक",
"support_5chan": "5chan का समर्थन करें",
"images": "छवियाँ",
"load_more": "और लोड करें"
"load_more": "और लोड करें",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Link a fájlhoz",
"support_5chan": "5chan támogatása",
"images": "képek",
"load_more": "További betöltése"
"load_more": "További betöltése",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Tautan ke File",
"support_5chan": "Dukung 5chan",
"images": "gambar",
"load_more": "Muat lebih banyak"
"load_more": "Muat lebih banyak",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Link al file",
"support_5chan": "Supporta 5chan",
"images": "immagini",
"load_more": "Carica altro"
"load_more": "Carica altro",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "ファイルへのリンク",
"support_5chan": "5chanをサポート",
"images": "画像",
"load_more": "さらに読み込む"
"load_more": "さらに読み込む",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "파일 링크",
"support_5chan": "5chan 지원",
"images": "이미지",
"load_more": "더 보기"
"load_more": "더 보기",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "फाइलची लिंक",
"support_5chan": "5chan चे समर्थन करा",
"images": "प्रतिमा",
"load_more": "अधिक लोड करा"
"load_more": "अधिक लोड करा",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Link naar bestand",
"support_5chan": "Steun 5chan",
"images": "afbeeldingen",
"load_more": "Meer laden"
"load_more": "Meer laden",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Lenke til fil",
"support_5chan": "Støtt 5chan",
"images": "bilder",
"load_more": "Last inn mer"
"load_more": "Last inn mer",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Link do pliku",
"support_5chan": "Wspieraj 5chan",
"images": "obrazy",
"load_more": "Załaduj więcej"
"load_more": "Załaduj więcej",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Link para o arquivo",
"support_5chan": "Apoiar 5chan",
"images": "imagens",
"load_more": "Carregar mais"
"load_more": "Carregar mais",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Link către fișier",
"support_5chan": "Sprijiniți 5chan",
"images": "imagini",
"load_more": "Încarcă mai mult"
"load_more": "Încarcă mai mult",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Ссылка на файл",
"support_5chan": "Поддержать 5chan",
"images": "изображения",
"load_more": "Загрузить ещё"
"load_more": "Загрузить ещё",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Lidhje me skedarin",
"support_5chan": "Mbështetni 5chan",
"images": "imazhe",
"load_more": "Ngarko më shumë"
"load_more": "Ngarko më shumë",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Länk till fil",
"support_5chan": "Stöd 5chan",
"images": "bilder",
"load_more": "Ladda mer"
"load_more": "Ladda mer",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "ఫైల్‌కు లింక్",
"support_5chan": "5chanకు మద్దతు ఇవ్వండి",
"images": "చిత్రాలు",
"load_more": "మరింత లోడ్ చేయండి"
"load_more": "మరింత లోడ్ చేయండి",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "ลิงก์ไปยังไฟล์",
"support_5chan": "สนับสนุน 5chan",
"images": "รูปภาพ",
"load_more": "โหลดเพิ่มเติม"
"load_more": "โหลดเพิ่มเติม",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Dosyaya bağlantı",
"support_5chan": "5chan'ı Destekle",
"images": "görseller",
"load_more": "Daha fazla yükle"
"load_more": "Daha fazla yükle",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Посилання на файл",
"support_5chan": "Підтримати 5chan",
"images": "зображення",
"load_more": "Завантажити ще"
"load_more": "Завантажити ще",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "فائل کا لنک",
"support_5chan": "5chan کی حمایت کریں",
"images": "تصاویر",
"load_more": "مزید لوڈ کریں"
"load_more": "مزید لوڈ کریں",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "Liên kết đến tệp",
"support_5chan": "Hỗ trợ 5chan",
"images": "hình ảnh",
"load_more": "Tải thêm"
"load_more": "Tải thêm",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
+3 -1
View File
@@ -297,5 +297,7 @@
"link_to_file": "链接到文件",
"support_5chan": "支持 5chan",
"images": "图片",
"load_more": "加载更多"
"load_more": "加载更多",
"purged": "purged",
"this_post_was_purged": "Purging from board database — this process is irreversible."
}
@@ -71,6 +71,7 @@ const CommentContent = ({ comment: post }: { comment: Comment }) => {
const isMobile = useIsMobile();
const { cid, content, deleted, edit, original, parentCid, postCid, pendingApproval, quotedCids, reason, removed, state, subplebbitAddress } = post || {};
const purged = post?.commentModeration?.purged;
const banned = !!post?.author?.subplebbit?.banExpiresAt;
const [showFullComment, setShowFullComment] = useState(false);
@@ -127,11 +128,13 @@ const CommentContent = ({ comment: post }: { comment: Comment }) => {
<blockquote className={`${styles.postMessage} ${!isReply && isMobile && styles.clampLines}`}>
{isReply &&
!hasFailedState &&
!(deleted || removed) &&
!(deleted || removed || purged) &&
(filteredQuotedCids.length > 0
? filteredQuotedCids.map((cid: string) => <QuotedCidLink key={cid} cid={cid} postCid={postCid} />)
: shouldShowReplyingToReply && <ReplyQuotePreview isQuotelinkReply={true} quotelinkReply={quotelinkReply} quotelinkNumber={parentNumber} />)}
{removed ? (
{purged ? (
<span className={styles.redEditMessage}>{capitalize(t('this_post_was_purged'))}</span>
) : removed ? (
reason ? (
<>
<span className={styles.redEditMessage}>({t('this_post_was_removed')})</span>
+17 -2
View File
@@ -20,13 +20,26 @@ interface MediaProps {
linkHeight?: number;
linkWidth?: number;
parentCid?: string;
purged?: boolean;
removed?: boolean;
spoiler?: boolean;
showThumbnail?: boolean;
setShowThumbnail: (showThumbnail: boolean) => void;
}
const Thumbnail = ({ commentMediaInfo, deleted, displayHeight, displayWidth, isFloatingEmbed, isOutOfFeed, isReply, removed, spoiler, setShowThumbnail }: MediaProps) => {
const Thumbnail = ({
commentMediaInfo,
deleted,
displayHeight,
displayWidth,
isFloatingEmbed,
isOutOfFeed,
isReply,
purged,
removed,
spoiler,
setShowThumbnail,
}: MediaProps) => {
const isMobile = useIsMobile();
const { patternThumbnailUrl, thumbnail, type, url } = commentMediaInfo || {};
@@ -133,7 +146,7 @@ const Thumbnail = ({ commentMediaInfo, deleted, displayHeight, displayWidth, isF
)
) : null;
return deleted || removed ? (
return deleted || removed || purged ? (
<img className={styles.fileDeleted} src='assets/filedeleted-res.gif' alt='File deleted' />
) : spoiler ? (
<img
@@ -381,6 +394,7 @@ const CommentMedia = ({
linkHeight,
linkWidth,
parentCid,
purged,
removed,
showThumbnail,
setShowThumbnail,
@@ -450,6 +464,7 @@ const CommentMedia = ({
isFloatingEmbed={isFloatingEmbed}
isOutOfFeed={isOutOfFeed}
deleted={deleted}
purged={purged}
removed={removed}
spoiler={spoiler}
setShowThumbnail={setShowThumbnail}
+22 -10
View File
@@ -93,6 +93,7 @@ const PostInfo = ({
}: PostProps & { directRepliesByParentCid?: Map<string, Comment[]> }) => {
const { t } = useTranslation();
const { author, cid, deleted, locked, pinned, parentCid, postCid, reason, removed, state, subplebbitAddress, timestamp } = post || {};
const purged = post?.commentModeration?.purged;
const title = post?.title?.trim();
const { address, shortAddress } = author || {};
const displayName = author?.displayName?.trim();
@@ -222,7 +223,7 @@ const PostInfo = ({
const handleUserAddressClick = useAuthorAddressClick();
const numberOfPostsByAuthor = (() => {
if (!showUserID || deleted || removed || !shortAddress || !postCid || typeof document === 'undefined') {
if (!showUserID || deleted || removed || purged || !shortAddress || !postCid || typeof document === 'undefined') {
return 0;
}
@@ -239,7 +240,7 @@ const PostInfo = ({
? isReply
? alert(t('this_reply_was_deleted'))
: alert(t('this_thread_was_deleted'))
: removed
: removed || purged
? isReply
? alert(t('this_reply_was_removed'))
: alert(t('this_thread_was_removed'))
@@ -266,7 +267,7 @@ const PostInfo = ({
return (
<div className={styles.postInfo}>
{isHidden ? parentCid && <span className={styles.hiddenReplyEditMenuSpacer} /> : <EditMenu post={post} />}
<span className={(hidden || ((removed || deleted) && !reason)) && parentCid ? styles.postDesktopHidden : ''}>
<span className={(hidden || ((removed || deleted || purged) && !reason)) && parentCid ? styles.postDesktopHidden : ''}>
{title &&
(title.length <= 75 ? (
<span className={styles.subject}>{title} </span>
@@ -276,11 +277,13 @@ const PostInfo = ({
</Tooltip>
))}
<span className={styles.nameBlock}>
<span className={`${styles.name} ${authorRole && !(deleted || removed) && (authorRole === 'mod' ? styles.capcodeMod : styles.capcodeAdmin)}`}>
<span className={`${styles.name} ${authorRole && !(deleted || removed || purged) && (authorRole === 'mod' ? styles.capcodeMod : styles.capcodeAdmin)}`}>
{deleted ? (
capitalize(t('deleted'))
) : removed ? (
capitalize(t('removed'))
) : purged ? (
capitalize(t('purged'))
) : displayName ? (
displayName.length <= 20 ? (
displayName
@@ -292,7 +295,7 @@ const PostInfo = ({
) : (
capitalize(t('anonymous'))
)}
{!(deleted || removed) && authorRole && (
{!(deleted || removed || purged) && authorRole && (
<span className='capitalize'>
{' '}
## Board {authorRole}{' '}
@@ -310,6 +313,8 @@ const PostInfo = ({
t('deleted')
) : removed ? (
t('removed')
) : purged ? (
t('purged')
) : !cid && pseudonymityMode ? (
<span className={styles.pendingCid}>{hasFailedState ? capitalize(t('failed')) : capitalize(t('pending'))}</span>
) : (
@@ -481,7 +486,7 @@ const PostInfo = ({
</span>
)}
</span>
{!(removed || deleted) && !isModQueue && <PostMenuDesktop postMenu={postMenuProps} />}
{!(removed || deleted || purged) && !isModQueue && <PostMenuDesktop postMenu={postMenuProps} />}
{cid && parentCid && <ReplyBacklinks post={post} quotedByMap={quotedByMap} directRepliesByParentCid={directRepliesByParentCid} />}
{cid && !parentCid && <OpBacklinks cid={cid} quotedByMap={quotedByMap} />}
</span>
@@ -544,6 +549,7 @@ interface PostMediaProps {
hasThumbnail: boolean;
spoiler: boolean;
deleted: boolean;
purged: boolean;
removed: boolean;
linkHeight: number;
linkWidth: number;
@@ -559,6 +565,7 @@ const PostMedia = ({
hasThumbnail,
spoiler,
deleted,
purged,
removed,
linkHeight,
linkWidth,
@@ -663,6 +670,7 @@ const PostMedia = ({
<CommentMedia
commentMediaInfo={commentMediaInfo}
deleted={deleted}
purged={purged}
removed={removed}
linkHeight={linkHeight}
linkWidth={linkWidth}
@@ -697,6 +705,7 @@ const Reply = ({
}
const { author, cid, deleted, link, linkHeight, linkWidth, postCid, reason, removed, spoiler, subplebbitAddress, thumbnailUrl, parentCid } = post || {};
const purged = post?.commentModeration?.purged;
const directories = useDirectories();
const boardPath = subplebbitAddress ? getBoardPath(subplebbitAddress, directories) : undefined;
@@ -726,12 +735,13 @@ const Reply = ({
quotedByMap={quotedByMap}
directRepliesByParentCid={directRepliesByParentCid}
/>
{link && !hidden && !(deleted || removed) && isValidURL(link) && (
{link && !hidden && !(deleted || removed || purged) && isValidURL(link) && (
<PostMedia
commentMediaInfo={commentMediaInfo}
hasThumbnail={hasThumbnail}
spoiler={spoiler}
deleted={deleted}
purged={!!purged}
removed={removed}
linkHeight={linkHeight}
linkWidth={linkWidth}
@@ -742,7 +752,7 @@ const Reply = ({
isInModView={isInModView}
/>
)}
{!hidden && (!(removed || deleted) || ((removed || deleted) && reason)) && <CommentContent comment={post} />}
{!hidden && (!(removed || deleted || purged) || ((removed || deleted) && reason)) && <CommentContent comment={post} />}
</div>
</div>
);
@@ -763,6 +773,7 @@ const PostDesktop = ({
}: PostProps) => {
const { t } = useTranslation();
const { author, cid, content, deleted, link, linkHeight, linkWidth, pinned, postCid, removed, spoiler, state, subplebbitAddress, thumbnailUrl, parentCid } = post || {};
const purged = post?.commentModeration?.purged;
const params = useParams();
const location = useLocation();
const navigationType = useNavigationType();
@@ -969,12 +980,13 @@ const PostDesktop = ({
</div>
</div>
)}
{link && !isHidden && !(deleted || removed) && isValidURL(link) && (
{link && !isHidden && !(deleted || removed || purged) && isValidURL(link) && (
<PostMedia
commentMediaInfo={commentMediaInfo}
hasThumbnail={hasThumbnail}
spoiler={spoiler}
deleted={deleted}
purged={!!purged}
removed={removed}
linkHeight={linkHeight}
linkWidth={linkWidth}
@@ -1000,7 +1012,7 @@ const PostDesktop = ({
quotedByMap={quotedByMap}
directRepliesByParentCid={directRepliesByParentCid}
/>
{!isHidden && !content && !(deleted || removed) && <div className={styles.spacer} />}
{!isHidden && !content && !(deleted || removed || purged) && <div className={styles.spacer} />}
{!isHidden && <CommentContent comment={post} />}
</div>
{!isHidden && !isInPendingPostView && showReplies && repliesCount > 0 && !isInPostPageView && (
+14 -6
View File
@@ -59,6 +59,7 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles, threadNumber }: Pos
const directories = useDirectories();
const { author, cid, deleted, link, linkHeight, linkWidth, locked, parentCid, pinned, postCid, reason, removed, state, subplebbitAddress, timestamp, thumbnailUrl } =
post || {};
const purged = post?.commentModeration?.purged;
const boardPath = subplebbitAddress ? getBoardPath(subplebbitAddress, directories) : undefined;
const displayBoardPath =
boardPath && subplebbitAddress
@@ -217,7 +218,7 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles, threadNumber }: Pos
? isReply
? alert(t('this_reply_was_deleted'))
: alert(t('this_thread_was_deleted'))
: removed
: removed || purged
? isReply
? alert(t('this_reply_was_removed'))
: alert(t('this_thread_was_removed'))
@@ -246,13 +247,15 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles, threadNumber }: Pos
<>
<div className={styles.postInfo}>
<PostMenuMobile postMenu={postMenuProps} editMenuPost={post} />
<span className={(hidden || ((removed || deleted) && !reason)) && parentCid ? styles.postDesktopHidden : ''}>
<span className={(hidden || ((removed || deleted || purged) && !reason)) && parentCid ? styles.postDesktopHidden : ''}>
<span className={styles.nameBlock}>
<span className={`${styles.name} ${authorRole && !(deleted || removed) && (authorRole === 'mod' ? styles.capcodeMod : styles.capcodeAdmin)}`}>
<span className={`${styles.name} ${authorRole && !(deleted || removed || purged) && (authorRole === 'mod' ? styles.capcodeMod : styles.capcodeAdmin)}`}>
{removed ? (
capitalize(t('removed'))
) : deleted ? (
capitalize(t('deleted'))
) : purged ? (
capitalize(t('purged'))
) : displayName ? (
displayName.length <= 20 ? (
displayName
@@ -264,7 +267,7 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles, threadNumber }: Pos
) : (
capitalize(t('anonymous'))
)}{' '}
{!(deleted || removed) && authorRole && (
{!(deleted || removed || purged) && authorRole && (
<span className='capitalize'>
{' '}
## Board {authorRole}{' '}
@@ -285,6 +288,8 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles, threadNumber }: Pos
lowerCase(t('removed'))
) : deleted ? (
lowerCase(t('deleted'))
) : purged ? (
lowerCase(t('purged'))
) : !cid && pseudonymityMode ? (
<span className={styles.pendingCid}>{hasFailedState ? capitalize(t('failed')) : capitalize(t('pending'))}</span>
) : (
@@ -423,7 +428,7 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles, threadNumber }: Pos
)}
</span>
</div>
{(hasThumbnail || link) && !(deleted || removed) && <PostMediaContent key={cid} post={post} link={link} />}
{(hasThumbnail || link) && !(deleted || removed || purged) && <PostMediaContent key={cid} post={post} link={link} />}
</>
);
};
@@ -431,6 +436,7 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles, threadNumber }: Pos
const PostMediaContent = ({ post, link }: { post: any; link: string }) => {
const [showThumbnail, setShowThumbnail] = useState(true);
const { thumbnailUrl, linkWidth, linkHeight, spoiler, deleted, removed, parentCid } = post || {};
const purged = post?.commentModeration?.purged;
const commentMediaInfo = useCommentMediaInfo(link, thumbnailUrl, linkWidth, linkHeight);
return (
@@ -438,6 +444,7 @@ const PostMediaContent = ({ post, link }: { post: any; link: string }) => {
<CommentMedia
commentMediaInfo={commentMediaInfo}
deleted={deleted}
purged={purged}
removed={removed}
linkHeight={linkHeight}
linkWidth={linkWidth}
@@ -519,6 +526,7 @@ const Reply = ({
post = editedComment;
}
const { author, cid, deleted, postCid, reason, removed, subplebbitAddress } = post || {};
const purged = post?.commentModeration?.purged;
const directories = useDirectories();
const boardPath = subplebbitAddress ? getBoardPath(subplebbitAddress, directories) : undefined;
const location = useLocation();
@@ -536,7 +544,7 @@ const Reply = ({
data-post-cid={postCid}
>
<PostInfoAndMedia post={post} postReplyCount={postReplyCount} roles={roles} threadNumber={threadNumber} />
{!hidden && (!(removed || deleted) || ((removed || deleted) && reason)) && <CommentContent comment={post} />}
{!hidden && (!(removed || deleted || purged) || ((removed || deleted) && reason)) && <CommentContent comment={post} />}
<ReplyBacklinks post={post} quotedByMap={quotedByMap} directRepliesByParentCid={directRepliesByParentCid} />
</div>
</div>
+1
View File
@@ -110,6 +110,7 @@ export const Post = memo(
prev?.pinned === next?.pinned &&
prev?.removed === next?.removed &&
prev?.deleted === next?.deleted &&
prev?.commentModeration?.purged === next?.commentModeration?.purged &&
prevProps.showAllReplies === nextProps.showAllReplies &&
prevProps.showReplies === nextProps.showReplies &&
prevProps.targetReplyCid === nextProps.targetReplyCid &&