From d019afe667fc3d30b57b7a03c67d7cd30ef9a927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?luis=CE=B4=CE=BC?= Date: Tue, 18 Feb 2025 17:25:43 +0100 Subject: [PATCH] :bug: Fix incorrect number of replies in comments (#5893) --- frontend/src/app/main/ui/comments.cljs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/ui/comments.cljs b/frontend/src/app/main/ui/comments.cljs index 9843f1b33..e607e07e7 100644 --- a/frontend/src/app/main/ui/comments.cljs +++ b/frontend/src/app/main/ui/comments.cljs @@ -621,9 +621,10 @@ [:> comment-content* {:content (:content item)}]] [:div {:class (stl/css :replies)} - (let [total-comments (:count-comments item 1) - total-replies (dec total-comments) - unread-replies (:count-unread-comments item 0)] + (let [total-comments (:count-comments item) + unread-comments (:count-unread-comments item) + total-replies (dec total-comments) + unread-replies (if (= unread-comments total-comments) (dec unread-comments) unread-comments)] [:* (when (> total-replies 0) (if (= total-replies 1)