From 5759f2bc3277ef134424a158a1281c3b042f117a Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 18 Jun 2020 16:50:47 +0200 Subject: [PATCH] Comment fixes Signed-off-by: Thomas Citharel --- js/src/components/Comment/Comment.vue | 4 ++++ lib/mobilizon/conversations/conversations.ex | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/js/src/components/Comment/Comment.vue b/js/src/components/Comment/Comment.vue index 884b7ea3..07f0b383 100644 --- a/js/src/components/Comment/Comment.vue +++ b/js/src/components/Comment/Comment.vue @@ -409,6 +409,10 @@ article { } } +.comment-replies { + flex-grow: 1; +} + .comment-replies-enter-active, .comment-replies-leave-active, .comment-replies-move { diff --git a/lib/mobilizon/conversations/conversations.ex b/lib/mobilizon/conversations/conversations.ex index 6f75034a..7bed61f6 100644 --- a/lib/mobilizon/conversations/conversations.ex +++ b/lib/mobilizon/conversations/conversations.ex @@ -68,7 +68,9 @@ defmodule Mobilizon.Conversations do Comment |> join(:left, [c], r in Comment, on: r.origin_comment_id == c.id) |> where([c, _], is_nil(c.in_reply_to_comment_id)) - |> where([_, r], is_nil(r.deleted_at)) + # TODO: This was added because we don't want to count deleted comments in total_replies. + # However, it also excludes all top-level comments with deleted replies from being selected + # |> where([_, r], is_nil(r.deleted_at)) |> group_by([c], c.id) |> select([c, r], %{c | total_replies: count(r.id)}) end