mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(replies): hide author-deleted replies from thread views
This commit is contained in:
@@ -2,12 +2,17 @@ import { BOARD_REPLIES_PREVIEW_VISIBLE_COUNT } from '../constants';
|
||||
|
||||
interface CommentLike {
|
||||
cid?: string | null;
|
||||
deleted?: boolean;
|
||||
index?: number;
|
||||
pendingApproval?: boolean;
|
||||
state?: string;
|
||||
timestamp?: number;
|
||||
}
|
||||
|
||||
export function filterRepliesForDisplay<T extends CommentLike>(replies: T[]): T[] {
|
||||
return replies.filter((reply) => !reply.deleted);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the latest N replies in chronological display order (oldest first).
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user