diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 242f5efd..bc2e53fd 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -13,6 +13,8 @@ class HomeController < ApplicationController private def set_data_for_meta + return if find_route_matches + if params[:username].present? @account = Account.find_local(params[:username]) elsif params[:account_username].present? @@ -35,13 +37,15 @@ class HomeController < ApplicationController return if user_signed_in? # if no current user, dont allow to navigate to these paths - matches = request.path.match(/\A\/(home|groups|tags|lists|notifications|explore|follow_requests|blocks|domain_blocks|mutes)/) - - if matches + if find_route_matches redirect_to(homepage_path) end end + def find_route_matches + request.path.match(/\A\/(home|groups|lists|notifications|explore|follow_requests|blocks|domain_blocks|mutes)/) + end + def set_initial_state_json serializable_resource = ActiveModelSerializers::SerializableResource.new(InitialStatePresenter.new(initial_state_params), serializer: InitialStateSerializer) @initial_state_json = serializable_resource.to_json