]> BookStack Code Mirror - bookstack/blobdiff - app/Activity/Tools/CommentTree.php
Comments: Moved to tab UI, Converted tabs component to ts
[bookstack] / app / Activity / Tools / CommentTree.php
index 13afc92521d452e659c51ae1fb55a1c13ef75d53..a05a9d24726f84ead259de6eb98670bd5b3a9881 100644 (file)
@@ -28,7 +28,7 @@ class CommentTree
 
     public function empty(): bool
     {
-        return count($this->tree) === 0;
+        return count($this->getActive()) === 0;
     }
 
     public function count(): int
@@ -41,11 +41,21 @@ class CommentTree
         return array_filter($this->tree, fn (CommentTreeNode $node) => !$node->comment->archived);
     }
 
+    public function activeThreadCount(): int
+    {
+        return count($this->getActive());
+    }
+
     public function getArchived(): array
     {
         return array_filter($this->tree, fn (CommentTreeNode $node) => $node->comment->archived);
     }
 
+    public function archivedThreadCount(): int
+    {
+        return count($this->getArchived());
+    }
+
     public function getCommentNodeForId(int $commentId): ?CommentTreeNode
     {
         foreach ($this->tree as $node) {