FIX: when category or tag is muted, update user (#9456)

Currently, when category or tag is muted, only after hard refresh, these new muted categories are really muted. Without a hard refresh, you will still receive "new topic" messages.

Therefore, when tag or category is muted, we should update the user object right away.
This commit is contained in:
Krzysztof Kotlarek
2020-04-21 08:33:55 +10:00
committed by GitHub
parent 74e4102093
commit e9f7262813
5 changed files with 41 additions and 2 deletions

View File

@ -274,7 +274,7 @@ class TagsController < ::ApplicationController
raise Discourse::NotFound unless tag
level = params[:tag_notification][:notification_level].to_i
TagUser.change(current_user.id, tag.id, level)
render json: { notification_level: level }
render json: { notification_level: level, tag_id: tag.id }
end
def check_hashtag