diff --git a/src/pages/status.jsx b/src/pages/status.jsx index 4c441bf2..406669eb 100644 --- a/src/pages/status.jsx +++ b/src/pages/status.jsx @@ -596,8 +596,6 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) { }); }, []); - const totalWeight = statuses?.length; - return (
)} {uiState === 'loading' && @@ -1010,8 +1008,14 @@ function SubComments({ replies, instance, hasParentThread, level, accWeight }) { .filter((a, i, arr) => arr.findIndex((b) => b.id === a.id) === i) .slice(0, 3); + const totalWeight = useMemo(() => { + return replies?.reduce((acc, reply) => { + return acc + reply?.weight; + }, accWeight); + }, [accWeight, replies?.length]); + let open = false; - if (accWeight <= MAX_WEIGHT) { + if (totalWeight <= MAX_WEIGHT) { open = true; } else if (!hasParentThread && totalComments === 1) { const shortReply = calcStatusWeight(replies[0]) < 2; @@ -1041,12 +1045,6 @@ function SubComments({ replies, instance, hasParentThread, level, accWeight }) { }; }, []); - const totalWeight = useMemo(() => { - return replies?.reduce((acc, reply) => { - return acc + reply?.weight; - }, 0); - }, [replies?.length]); - return (
)}