From f6897ef4d8b43ae40b536edaad85fe862fae29f7 Mon Sep 17 00:00:00 2001
From: Lim Chee Aun <cheeaun@gmail.com>
Date: Tue, 7 Feb 2023 12:01:36 +0800
Subject: [PATCH] Don't open sub comments is parent is a thread

---
 src/pages/status.jsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/pages/status.jsx b/src/pages/status.jsx
index cbe2947e..d001e2ab 100644
--- a/src/pages/status.jsx
+++ b/src/pages/status.jsx
@@ -667,6 +667,7 @@ function StatusPage() {
                       instance={instance}
                       hasManyStatuses={hasManyStatuses}
                       replies={replies}
+                      hasParentThread={thread}
                     />
                   )}
                   {uiState === 'loading' &&
@@ -746,7 +747,7 @@ function StatusPage() {
   );
 }
 
-function SubComments({ hasManyStatuses, replies, instance }) {
+function SubComments({ hasManyStatuses, replies, instance, hasParentThread }) {
   // Set isBrief = true:
   // - if less than or 2 replies
   // - if replies have no sub-replies
@@ -783,7 +784,7 @@ function SubComments({ hasManyStatuses, replies, instance }) {
     .filter((a, i, arr) => arr.findIndex((b) => b.id === a.id) === i)
     .slice(0, 3);
 
-  const open = isBrief || !hasManyStatuses;
+  const open = !hasParentThread && (isBrief || !hasManyStatuses);
 
   return (
     <details class="replies" open={open}>