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

@@ -12,7 +12,7 @@ class TopicsBulkAction
def self.operations
@operations ||= %w(change_category close archive change_notification_level
reset_read dismiss_posts delete unlist archive_messages
destroy_post_timing dismiss_posts delete unlist archive_messages
move_messages_to_inbox change_tags append_tags remove_tags
relist dismiss_topics)
end
@@ -98,8 +98,11 @@ class TopicsBulkAction
@changed_ids = rows.map { |row| row[:topic_id] }
end
def reset_read
PostTiming.destroy_for(@user.id, @topic_ids)
def destroy_post_timing
topics.each do |t|
PostTiming.destroy_last_for(@user, topic: t)
@changed_ids << t.id
end
end
def change_category