Removed promotions from initial_state
This commit is contained in:
parent
547cb39dee
commit
f806fddb5f
|
@ -17,7 +17,6 @@ export const repository = getMeta('repository');
|
|||
export const source_url = getMeta('source_url');
|
||||
export const version = getMeta('version');
|
||||
export const isStaff = getMeta('is_staff');
|
||||
export const promotions = initialState && initialState.promotions;
|
||||
export const unreadCount = getMeta('unread_count');
|
||||
export const lastReadNotificationId = getMeta('last_read_notification_id');
|
||||
export const monthlyExpensesComplete = getMeta('monthly_expenses_complete');
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue