Commit f806fddb authored by mgabdev's avatar mgabdev

Removed promotions from initial_state

parent 547cb39d
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment