FEATURE: Rename Reset Read bulk action to Defer (#15972)

It is enabled only if defer is enabled in user options too and if the
button shows up in the topic's footer.
This commit is contained in:
Bianca Nenciu
2022-02-21 22:45:01 +02:00
committed by GitHub
parent 94883dd326
commit 90c3695ab0
8 changed files with 34 additions and 23 deletions

View File

@ -58,8 +58,8 @@ class PostTiming < ActiveRecord::Base
record_new_timing(args) if rows == 0
end
def self.destroy_last_for(user, topic_id)
topic = Topic.find(topic_id)
def self.destroy_last_for(user, topic_id: nil, topic: nil)
topic ||= Topic.find(topic_id)
post_number = user.staff? ? topic.highest_staff_post_number : topic.highest_post_number
last_read = post_number - 1