[Comments] Fix own hidden comments visible on index if show_hidden_comments == false

This commit is contained in:
Earlopain 2024-01-26 16:38:52 +01:00
parent 10e3f1662a
commit fe5434e157
No known key found for this signature in database
GPG Key ID: 48860312319ADF61
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<div id="p-index-by-comment" class="comments-for-post">
<% @comments.each do |comment| %>
<% if comment.post.present? && comment.visible_to?(CurrentUser.user) %>
<% if comment.post.present? && comment.should_see?(CurrentUser.user) %>
<div class="comment-post">
<div class="post-container">
<%= PostPresenter.preview(comment.post, inline: true, show_deleted: true) %>

View File

@ -1,4 +1,4 @@
<% if comment.visible_to?(CurrentUser.user) && comment.should_see?(CurrentUser.user) %>
<% if comment.should_see?(CurrentUser.user) %>
<article class="comment comment-post-grid <%= "below-threshold" if comment.below_threshold? %>" data-post-id="<%= comment.post_id %>"
data-comment-id="<%= comment.id %>" data-score="<%= comment.score %>"
data-creator="<%= comment.creator&.name.downcase %>" data-is-sticky="<%= comment.is_sticky %>" data-creator-id="<%= comment.creator_id %>"