2
0

Expose enabled features to the frontend (#35348)

This commit is contained in:
Echo
2025-07-11 15:15:22 +02:00
committed by GitHub
parent 88b0f3a172
commit 94bceb8683
2 changed files with 14 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ class InitialStateSerializer < ActiveModel::Serializer
attributes :meta, :compose, :accounts,
:media_attachments, :settings,
:languages
:languages, :features
attribute :critical_updates_pending, if: -> { object&.role&.can?(:view_devops) && SoftwareUpdate.check_enabled? }
@@ -85,6 +85,10 @@ class InitialStateSerializer < ActiveModel::Serializer
LanguagesHelper::SUPPORTED_LOCALES.map { |(key, value)| [key, value[0], value[1]] }
end
def features
Mastodon::Feature.enabled_features
end
private
def default_meta_store