Removed unused code from initial_state and ReactController
• Removed: - unused code from initial_state and ReactController
This commit is contained in:
parent
83006eed39
commit
b0e3d611f5
|
@ -71,12 +71,9 @@ class ReactController < ApplicationController
|
||||||
push_subscription: current_account.user.web_push_subscription(current_session),
|
push_subscription: current_account.user.web_push_subscription(current_session),
|
||||||
current_account: current_account,
|
current_account: current_account,
|
||||||
token: current_session.token,
|
token: current_session.token,
|
||||||
admin: Account.find_local(Setting.site_contact_username.strip.gsub(/\A@/, '')),
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
admin: Account.find_local(Setting.site_contact_username.strip.gsub(/\A@/, '')),
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return {}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
module InstanceHelper
|
module InstanceHelper
|
||||||
def site_title
|
def site_title
|
||||||
Setting.site_title
|
Setting::SITE_TITLE
|
||||||
end
|
end
|
||||||
|
|
||||||
def site_hostname
|
def site_hostname
|
||||||
|
|
|
@ -13,12 +13,9 @@ export const boostModal = getMeta('boost_modal');
|
||||||
export const deleteModal = getMeta('delete_modal');
|
export const deleteModal = getMeta('delete_modal');
|
||||||
export const me = getMeta('me');
|
export const me = getMeta('me');
|
||||||
export const meUsername = getMeta('username');
|
export const meUsername = getMeta('username');
|
||||||
export const searchEnabled = getMeta('search_enabled');
|
|
||||||
export const invitesEnabled = getMeta('invites_enabled');
|
|
||||||
export const repository = getMeta('repository');
|
export const repository = getMeta('repository');
|
||||||
export const source_url = getMeta('source_url');
|
export const source_url = getMeta('source_url');
|
||||||
export const version = getMeta('version');
|
export const version = getMeta('version');
|
||||||
export const profile_directory = getMeta('profile_directory');
|
|
||||||
export const isStaff = getMeta('is_staff');
|
export const isStaff = getMeta('is_staff');
|
||||||
export const promotions = initialState && initialState.promotions;
|
export const promotions = initialState && initialState.promotions;
|
||||||
export const unreadCount = getMeta('unread_count');
|
export const unreadCount = getMeta('unread_count');
|
||||||
|
|
|
@ -18,7 +18,7 @@ class ProofProvider::Keybase::ConfigSerializer < ActiveModel::Serializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def display_name
|
def display_name
|
||||||
Setting.site_title
|
Setting::SITE_TITLE
|
||||||
end
|
end
|
||||||
|
|
||||||
def logo
|
def logo
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
class Setting < RailsSettings::Base
|
class Setting < RailsSettings::Base
|
||||||
source Rails.root.join('config', 'settings.yml')
|
source Rails.root.join('config', 'settings.yml')
|
||||||
|
|
||||||
|
SITE_TITLE = 'Gab Social'
|
||||||
|
|
||||||
def to_param
|
def to_param
|
||||||
var
|
var
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
class InitialStatePresenter < ActiveModelSerializers::Model
|
class InitialStatePresenter < ActiveModelSerializers::Model
|
||||||
attributes :settings, :push_subscription, :token,
|
attributes :settings, :push_subscription, :token,
|
||||||
:current_account, :admin, :text
|
:current_account, :text
|
||||||
end
|
end
|
||||||
|
|
|
@ -51,8 +51,5 @@ class InstancePresenter
|
||||||
def hero
|
def hero
|
||||||
@hero ||= Rails.cache.fetch('site_uploads/hero') { SiteUpload.find_by(var: 'hero') }
|
@hero ||= Rails.cache.fetch('site_uploads/hero') { SiteUpload.find_by(var: 'hero') }
|
||||||
end
|
end
|
||||||
|
|
||||||
def mascot
|
|
||||||
@mascot ||= Rails.cache.fetch('site_uploads/mascot') { SiteUpload.find_by(var: 'mascot') }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,14 +13,9 @@ class InitialStateSerializer < ActiveModel::Serializer
|
||||||
access_token: object.token,
|
access_token: object.token,
|
||||||
locale: I18n.locale,
|
locale: I18n.locale,
|
||||||
domain: Rails.configuration.x.local_domain,
|
domain: Rails.configuration.x.local_domain,
|
||||||
admin: object.admin&.id&.to_s,
|
|
||||||
search_enabled: Chewy.enabled?,
|
|
||||||
repository: GabSocial::Version.repository,
|
repository: GabSocial::Version.repository,
|
||||||
source_url: GabSocial::Version.source_url,
|
source_url: GabSocial::Version.source_url,
|
||||||
version: GabSocial::Version.to_s,
|
version: GabSocial::Version.to_s,
|
||||||
invites_enabled: Setting.min_invite_role == 'user',
|
|
||||||
mascot: instance_presenter.mascot&.file&.url,
|
|
||||||
profile_directory: Setting.profile_directory,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if object.current_account
|
if object.current_account
|
||||||
|
@ -63,7 +58,6 @@ class InitialStateSerializer < ActiveModel::Serializer
|
||||||
def accounts
|
def accounts
|
||||||
store = {}
|
store = {}
|
||||||
store[object.current_account.id.to_s] = ActiveModelSerializers::SerializableResource.new(object.current_account, serializer: REST::AccountSerializer) if object.current_account
|
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
|
store
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -10,15 +10,15 @@ class ManifestSerializer < ActiveModel::Serializer
|
||||||
:share_target
|
:share_target
|
||||||
|
|
||||||
def name
|
def name
|
||||||
object.site_title
|
'Gab Social'
|
||||||
end
|
end
|
||||||
|
|
||||||
def short_name
|
def short_name
|
||||||
object.site_title
|
'Gab Social'
|
||||||
end
|
end
|
||||||
|
|
||||||
def description
|
def description
|
||||||
strip_tags(object.site_short_description.presence || I18n.t('about.about_gabsocial_html'))
|
'Gab is a social network that champions free speech, individual liberty and the free flow of information online. All are welcome.'
|
||||||
end
|
end
|
||||||
|
|
||||||
def icons
|
def icons
|
||||||
|
|
|
@ -16,7 +16,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def title
|
def title
|
||||||
Setting.site_title
|
Setting::SITE_TITLE
|
||||||
end
|
end
|
||||||
|
|
||||||
def description
|
def description
|
||||||
|
|
Loading…
Reference in New Issue