discourse/app/serializers/sidebar_url_serializer.rb
Krzysztof Kotlarek 3c019b1c0f
FIX: consistent sidebar section external links (#22343)
Before this change, links which required full reload because they are not in ember routes like `/my/preferences` or links to docs like `/pub/*` were treated as real external links. Therefore, they were opening in self window or new tab based on user  `external_links_in_new_tab` setting.

To be consistent with behavior when full reload links are in the post, they are treated as internal and always open in the same window.
2023-06-30 12:25:43 +10:00

14 lines
252 B
Ruby

# frozen_string_literal: true
class SidebarUrlSerializer < ApplicationSerializer
attributes :id, :name, :value, :icon, :external, :full_reload, :segment
def external
object.external?
end
def full_reload
object.full_reload?
end
end