mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 12:57:17 +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
@ -84,6 +84,7 @@ class TopicList < DraftableList
|
||||
|
||||
# Attach some data for serialization to each topic
|
||||
@topic_lookup = TopicUser.lookup_for(@current_user, @topics) if @current_user
|
||||
@dismissed_topic_users_lookup = DismissedTopicUser.lookup_for(@current_user, @topics) if @current_user
|
||||
|
||||
post_action_type =
|
||||
if @current_user
|
||||
@ -119,6 +120,8 @@ class TopicList < DraftableList
|
||||
ft.category_user_data = @category_user_lookup[ft.category_id]
|
||||
end
|
||||
|
||||
ft.dismissed = @current_user && @dismissed_topic_users_lookup.include?(ft.id)
|
||||
|
||||
if ft.user_data && post_action_lookup && actions = post_action_lookup[ft.id]
|
||||
ft.user_data.post_action_data = { post_action_type => actions }
|
||||
end
|
||||
|
Reference in New Issue
Block a user