Removed promotions from initial_state

This commit is contained in:
mgabdev
2020-11-09 13:26:34 -06:00
parent 547cb39dee
commit f806fddb5f
2 changed files with 1 additions and 13 deletions

View File

@@ -2,8 +2,7 @@
class InitialStateSerializer < ActiveModel::Serializer
attributes :meta, :compose, :accounts,
:media_attachments, :settings,
:promotions
:media_attachments, :settings
has_one :push_subscription, serializer: REST::WebPushSubscriptionSerializer
@@ -65,16 +64,6 @@ class InitialStateSerializer < ActiveModel::Serializer
{ accept_content_types: MediaAttachment::IMAGE_FILE_EXTENSIONS + MediaAttachment::VIDEO_FILE_EXTENSIONS + MediaAttachment::IMAGE_MIME_TYPES + MediaAttachment::VIDEO_MIME_TYPES }
end
def promotions
if object.current_account
if object.current_account.is_pro
return []
end
end
ActiveModelSerializers::SerializableResource.new(Promotion.active, each_serializer: REST::PromotionSerializer)
end
private
def unread_count(account)