From 2cf1a16ff73bb7401579ca6306e0a537ba2fe12e Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 11 Jan 2020 03:03:26 -0600 Subject: pass monsterfork api exposure setting to initial state serializer --- app/controllers/home_controller.rb | 2 +- app/controllers/public_timelines_controller.rb | 2 +- app/controllers/shares_controller.rb | 2 +- app/controllers/tags_controller.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 97a0a72d9..d086d19cd 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -46,7 +46,7 @@ class HomeController < ApplicationController end def set_initial_state_json - serializable_resource = ActiveModelSerializers::SerializableResource.new(InitialStatePresenter.new(initial_state_params), serializer: InitialStateSerializer) + serializable_resource = ActiveModelSerializers::SerializableResource.new(InitialStatePresenter.new(initial_state_params), serializer: InitialStateSerializer), monsterfork_api: monsterfork_api @initial_state_json = serializable_resource.to_json end diff --git a/app/controllers/public_timelines_controller.rb b/app/controllers/public_timelines_controller.rb index c5fe789f4..ab774c20c 100644 --- a/app/controllers/public_timelines_controller.rb +++ b/app/controllers/public_timelines_controller.rb @@ -13,7 +13,7 @@ class PublicTimelinesController < ApplicationController format.html do @initial_state_json = ActiveModelSerializers::SerializableResource.new( InitialStatePresenter.new(settings: { known_fediverse: Setting.show_known_fediverse_at_about_page }, token: current_session&.token), - serializer: InitialStateSerializer + serializer: InitialStateSerializer, monsterfork_api: monsterfork_api ).to_json end end diff --git a/app/controllers/shares_controller.rb b/app/controllers/shares_controller.rb index ada4eec54..5d7a14949 100644 --- a/app/controllers/shares_controller.rb +++ b/app/controllers/shares_controller.rb @@ -8,7 +8,7 @@ class SharesController < ApplicationController before_action :set_body_classes def show - serializable_resource = ActiveModelSerializers::SerializableResource.new(InitialStatePresenter.new(initial_state_params), serializer: InitialStateSerializer) + serializable_resource = ActiveModelSerializers::SerializableResource.new(InitialStatePresenter.new(initial_state_params), serializer: InitialStateSerializer), monsterfork_api: monsterfork_api @initial_state_json = serializable_resource.to_json end diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 5cb048c1a..f89e8afba 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -16,7 +16,7 @@ class TagsController < ApplicationController use_pack 'about' @initial_state_json = ActiveModelSerializers::SerializableResource.new( InitialStatePresenter.new(settings: {}, token: current_session&.token), - serializer: InitialStateSerializer + serializer: InitialStateSerializer, monsterfork_api: monsterfork_api ).to_json end -- cgit