Limit threads count total to 100

pull/1247/head
Lim Chee Aun 2025-08-23 19:06:53 +08:00
rodzic 57ee92cf76
commit 56a239e89f
2 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -13,7 +13,7 @@ function ThreadBadge({ index, showIcon, showText }) {
const { t } = useLingui();
const total = useContext(ThreadCountContext);
const hasIndex = index > 0;
const hasTotal = (total || 0) > 0;
const hasTotal = total > 0;
return (
<div class="status-thread-badge">

Wyświetl plik

@ -527,7 +527,8 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) {
: mappedNestedDescendants.filter((s) => s.thread);
const threadsCount =
(ancestorsIsThread ? ancestors.length : 0) + descendantsThread.length;
if (threadsCount) {
if (threadsCount > 0 && threadsCount < 100) {
// Cap at 100 because there's no point showing 100+
// Include hero as part of thread count
setThreadsCount(threadsCount + 1);
}