]> git.openstreetmap.org Git - rails.git/commitdiff
Improves dropping of first note's comment
authorNenad Vujicic <nenadus@gmail.com>
Wed, 19 Feb 2025 15:10:10 +0000 (16:10 +0100)
committerNenad Vujicic <nenadus@gmail.com>
Thu, 20 Feb 2025 23:26:16 +0000 (00:26 +0100)
Improves calculating comments to be displayed by dropping first comment only if it is opening.

app/controllers/notes_controller.rb

index 5d817c9c6cf3f525d4669de10174332978f3e6f0..fbeb01b76425b890f4b69dd603ddf96e255abf8c 100644 (file)
@@ -43,7 +43,7 @@ class NotesController < ApplicationController
 
     @note_includes_anonymous = @note.author.nil? || @note_comments.find { |comment| comment.author.nil? }
 
-    @note_comments = @note_comments.drop(1) if @note.author.nil? || @note.author.active?
+    @note_comments = @note_comments.drop(1) if @note_comments.first&.event == "opened"
   rescue ActiveRecord::RecordNotFound
     render :template => "browse/not_found", :status => :not_found
   end