[openstreetmap/openstreetmap-website] Fixes bug when deleted user's note lacks comments (PR #5609)
Anton Khorev
notifications at github.com
Wed Feb 5 13:18:09 UTC 2025
@AntonKhorev commented on this pull request.
> @@ -52,10 +52,10 @@
<% end %>
</div>
- <% if @note_comments.length > 1 %>
+ <% if @note_comments.length > (!@note.author.nil? && @note.author.status == "deleted" ? 0 : 1) %>
I think it's better to make `@note_comments` contain true comments in the controller instead of having this condition checked twice here.
`@note_comments` were used in three places of this view: description, anonymous warning and discussion.
- Description is handled differently now.
- Discussion is going to work with all `@note_comments` without deciding which to drop.
- Anonymous warning will need to check if either note author is nil or any comment's author is nil. Maybe this check is also better done in the controller and saved to some variable.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5609#pullrequestreview-2595757498
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5609/review/2595757498 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250205/8bd4ceb8/attachment.htm>
More information about the rails-dev
mailing list