mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 07:37:55 +08:00
BUGFIX: don't show redirect reason if you aren't redirected
Move the redirect to top page logic server-side and make sure the reason is not shown when top is not in the navigation menu (top_menu).
This commit is contained in:
@ -17,7 +17,9 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
:can_edit,
|
||||
:can_invite_to_forum,
|
||||
:no_password,
|
||||
:can_delete_account
|
||||
:can_delete_account,
|
||||
:should_be_redirected_to_top,
|
||||
:redirected_to_top_reason
|
||||
|
||||
def include_site_flagged_posts_count?
|
||||
object.staff?
|
||||
@ -63,4 +65,8 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
true
|
||||
end
|
||||
|
||||
def include_redirected_to_top_reason?
|
||||
object.should_be_redirected_to_top
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user