kopia lustrzana https://github.com/cheeaun/phanpy
Limit threads count total to 100
rodzic
57ee92cf76
commit
56a239e89f
|
@ -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">
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue