Comment fixes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-06-18 16:50:47 +02:00
parent e030eab93d
commit 5759f2bc32
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
2 changed files with 7 additions and 1 deletions

View File

@ -409,6 +409,10 @@ article {
}
}
.comment-replies {
flex-grow: 1;
}
.comment-replies-enter-active,
.comment-replies-leave-active,
.comment-replies-move {

View File

@ -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