diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5230135..9e98ade 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -474,7 +474,7 @@ class ApplicationController < ActionController::Base session[:mobile_param] = if request.path.eql?(@mobile_path) '1' - elsif request.path.eql?(root_path) + elsif (request.path.eql?(root_path) && mobile_device?) redirect_to mobile_path elsif params[:mobile] params[:mobile] @@ -501,9 +501,8 @@ class ApplicationController < ActionController::Base session[:mobile_param] = if (request.path.eql?(@mobile_path)) '1' - elsif request.path.eql?(root_path) - redirect_to mobile_path - elsif request.path.eql?(@mobile_app_path) + + elsif (request.path.eql?(@mobile_app_path) && mobile_device?) redirect_to root_path(mobile: 0) elsif params[:mobile] params[:mobile]