@ -53,21 +53,21 @@ class InitialStateSerializer < ActiveModel::Serializer
if object . current_account
store [ :me ] = object . current_account . id . to_s
store [ :unfollow_modal ] = object . current_account . user. setting_unfollow_modal
store [ :boost_modal ] = object . current_account . user. setting_boost_modal
store [ :favourite_modal ] = object . current_account . user. setting_favourite_modal
store [ :delete_modal ] = object . current_account . user. setting_delete_modal
store [ :auto_play_gif ] = object . current_account . user. setting_auto_play_gif
store [ :display_media ] = object . current_account . user. setting_display_media
store [ :expand_spoilers ] = object . current_account . user. setting_expand_spoilers
store [ :reduce_motion ] = object . current_account . user. setting_reduce_motion
store [ :disable_swiping ] = object . current_account . user. setting_disable_swiping
store [ :advanced_layout ] = object . current_account . user. setting_advanced_layout
store [ :use_blurhash ] = object . current_account . user. setting_use_blurhash
store [ :use_pending_items ] = object . current_account . user. setting_use_pending_items
store [ :default_content_type ] = object . current_account . user. setting_default_content_type
store [ :system_emoji_font ] = object . current_account . user. setting_system_emoji_font
store [ :show_trends ] = Setting . trends && object . current_account . user. setting_trends
store [ :unfollow_modal ] = object _account_ user. setting_unfollow_modal
store [ :boost_modal ] = object _account_ user. setting_boost_modal
store [ :favourite_modal ] = object _account_ user. setting_favourite_modal
store [ :delete_modal ] = object _account_ user. setting_delete_modal
store [ :auto_play_gif ] = object _account_ user. setting_auto_play_gif
store [ :display_media ] = object _account_ user. setting_display_media
store [ :expand_spoilers ] = object _account_ user. setting_expand_spoilers
store [ :reduce_motion ] = object _account_ user. setting_reduce_motion
store [ :disable_swiping ] = object _account_ user. setting_disable_swiping
store [ :advanced_layout ] = object _account_ user. setting_advanced_layout
store [ :use_blurhash ] = object _account_ user. setting_use_blurhash
store [ :use_pending_items ] = object _account_ user. setting_use_pending_items
store [ :default_content_type ] = object _account_ user. setting_default_content_type
store [ :system_emoji_font ] = object _account_ user. setting_system_emoji_font
store [ :show_trends ] = Setting . trends && object _account_ user. setting_trends
else
store [ :auto_play_gif ] = Setting . auto_play_gif
store [ :display_media ] = Setting . display_media
@ -88,9 +88,9 @@ class InitialStateSerializer < ActiveModel::Serializer
if object . current_account
store [ :me ] = object . current_account . id . to_s
store [ :default_privacy ] = object . visibility || object . current_account . user. setting_default_privacy
store [ :default_sensitive ] = object . current_account . user. setting_default_sensitive
store [ :default_language ] = object . current_account . user. preferred_posting_language
store [ :default_privacy ] = object . visibility || object _account_ user. setting_default_privacy
store [ :default_sensitive ] = object _account_ user. setting_default_sensitive
store [ :default_language ] = object _account_ user. preferred_posting_language
end
store [ :text ] = object . text if object . text
@ -106,11 +106,11 @@ class InitialStateSerializer < ActiveModel::Serializer
associations : [ :account_stat , :user , { moved_to_account : [ :account_stat , :user ] } ]
)
store [ object . current_account . id . to_s ] = ActiveModelSerializers :: SerializableResource . new ( object . current_account , serializer : REST :: AccountSerializer ) if object . current_account
store [ object . admin . id . to_s ] = ActiveModelSerializers :: SerializableResource . new ( object . admin , serializer : REST :: AccountSerializer ) if object . admin
store [ object . owner . id . to_s ] = ActiveModelSerializers :: SerializableResource . new ( object . owner , serializer : REST :: AccountSerializ er) if object . owner
store [ object . disabled_account . id . to_s ] = ActiveModelSerializers :: SerializableResource . new ( object . disabled_account , serializer : REST :: AccountSerializer ) if object . disabled_account
store [ object . moved_to_account . id . to_s ] = ActiveModelSerializers :: SerializableResource . new ( object . moved_to_account , serializer : REST :: AccountSerializer ) if object . moved_to_account
store [ object . current_account . id . to_s ] = serialized_account ( object . current_account ) if object . current_account
store [ object . admin . id . to_s ] = serialized_account ( object . admin ) if object . admin
store [ object . owner . id . to_s ] = serialized_account ( object . own er) if object . owner
store [ object . disabled_account . id . to_s ] = serialized_account ( object . disabled_account ) if object . disabled_account
store [ object . moved_to_account . id . to_s ] = serialized_account ( object . moved_to_account ) if object . moved_to_account
store
end
@ -125,6 +125,14 @@ class InitialStateSerializer < ActiveModel::Serializer
private
def object_account_user
object . current_account . user
end
def serialized_account ( account )
ActiveModelSerializers :: SerializableResource . new ( account , serializer : REST :: AccountSerializer )
end
def instance_presenter
@instance_presenter || = InstancePresenter . new
end