fix(replies): hide no-reason removed replies

This commit is contained in:
Tommaso Casaburi
2026-06-23 16:20:15 +07:00
parent da92b2fb0a
commit 4737d37967
4 changed files with 16 additions and 7 deletions
+3 -1
View File
@@ -6,6 +6,8 @@ interface CommentLike {
index?: number;
number?: number;
pendingApproval?: boolean;
reason?: string | null;
removed?: boolean;
state?: string;
timestamp?: number;
}
@@ -44,7 +46,7 @@ export function sortRepliesForDisplay<T extends CommentLike>(replies: T[]): T[]
}
export function filterRepliesForDisplay<T extends CommentLike>(replies: T[]): T[] {
return replies.filter((reply) => !reply.deleted);
return replies.filter((reply) => !reply.deleted && (!reply.removed || Boolean(reply.reason?.trim())));
}
/**