mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Remove tags from experimental sidebar on notification level changed (#17083)
As part of this commit, a bug where updating a tag's notification level on the server side does not update the state of the user's tag notification levels on the client side is fixed too.
This commit is contained in:

committed by
GitHub

parent
47034d9ca0
commit
e7e23e8d9c
@ -1,6 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CurrentUserSerializer < BasicUserSerializer
|
||||
include UserTagNotificationsMixin
|
||||
|
||||
attributes :name,
|
||||
:unread_notifications,
|
||||
@ -33,7 +34,6 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
:tracked_category_ids,
|
||||
:watched_first_post_category_ids,
|
||||
:watched_category_ids,
|
||||
:muted_tag_ids,
|
||||
:watched_tags,
|
||||
:watching_first_post_tags,
|
||||
:tracked_tags,
|
||||
@ -230,32 +230,6 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
categories_with_notification_level(:watching_first_post)
|
||||
end
|
||||
|
||||
# this is a weird outlier that is used for topic tracking state which
|
||||
# needs the actual ids, which is why it is duplicated with muted_tags
|
||||
def muted_tag_ids
|
||||
TagUser.lookup(object, :muted).pluck(:tag_id)
|
||||
end
|
||||
|
||||
def muted_tags
|
||||
tags_with_notification_level(:muted)
|
||||
end
|
||||
|
||||
def tracked_tags
|
||||
tags_with_notification_level(:tracking)
|
||||
end
|
||||
|
||||
def watching_first_post_tags
|
||||
tags_with_notification_level(:watching_first_post)
|
||||
end
|
||||
|
||||
def watched_tags
|
||||
tags_with_notification_level(:watching)
|
||||
end
|
||||
|
||||
def regular_tags
|
||||
tags_with_notification_level(:regular)
|
||||
end
|
||||
|
||||
def ignored_users
|
||||
IgnoredUser.where(user: object.id).joins(:ignored_user).pluck(:username)
|
||||
end
|
||||
|
Reference in New Issue
Block a user