This commit is contained in:
mgabdev
2020-12-15 19:31:30 -05:00
parent de0c977950
commit 75d52c841e
129 changed files with 2559 additions and 910 deletions

View File

@@ -31,6 +31,7 @@ class InitialStateSerializer < ActiveModel::Serializer
store[:unread_count] = unread_count object.current_account
store[:last_read_notification_id] = object.current_account.user.last_read_notification
store[:monthly_expenses_complete] = Redis.current.get("monthly_funding_amount") || 0
store[:trending_hashtags] = get_trending_hashtags
store[:is_first_session] = is_first_session object.current_account
store[:email_confirmed] = object.current_account.user.confirmed?
store[:email] = object.current_account.user.confirmed? ? '[hidden]' : object.current_account.user.email
@@ -39,6 +40,7 @@ class InitialStateSerializer < ActiveModel::Serializer
store
end
def compose
store = {}
@@ -78,4 +80,9 @@ class InitialStateSerializer < ActiveModel::Serializer
object.current_account.user.sign_in_count === 1
end
def get_trending_hashtags
tags = Redis.current.get("admin_trending_hashtags") || ""
return tags.strip.split(", ")
end
end