mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 06:51:27 +08:00
FEATURE: New way to dismiss new topics (#11927)
This is a try to simplify logic around dismiss new topics to have one solution to work in all places - dismiss all-new, dismiss new in a specific category or even in a specific tag.
This commit is contained in:

committed by
GitHub

parent
151193bb11
commit
f39e7fe81d
@ -897,12 +897,8 @@ class TopicsController < ApplicationController
|
||||
if params[:include_subcategories] == 'true'
|
||||
category_ids = category_ids.concat(Category.where(parent_category_id: params[:category_id]).pluck(:id))
|
||||
end
|
||||
DismissTopics.new(current_user, Topic.where(category_id: category_ids)).perform!
|
||||
category_ids.each do |category_id|
|
||||
current_user
|
||||
.category_users
|
||||
.where(category_id: category_id)
|
||||
.first_or_initialize
|
||||
.update!(last_seen_at: Time.zone.now)
|
||||
TopicTrackingState.publish_dismiss_new(current_user.id, category_id)
|
||||
end
|
||||
else
|
||||
|
Reference in New Issue
Block a user