From 8a012d4c91e47e4426ded1ffa97935202cfd2afa Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 14 Mar 2018 17:09:01 -0500 Subject: [PATCH] Remove unused mobile mode code (#3206). Mobile mode was removed in 31e36cf. --- app/controllers/application_controller.rb | 1 - app/logical/current_user.rb | 9 --------- app/models/post.rb | 12 ++++-------- app/views/layouts/default.html.erb | 1 - 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b37a9cbd8..1dfeccf39 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -172,7 +172,6 @@ class ApplicationController < ActionController::Base def reset_current_user CurrentUser.user = nil CurrentUser.ip_addr = nil - CurrentUser.mobile_mode = false end def set_started_at_session diff --git a/app/logical/current_user.rb b/app/logical/current_user.rb index 2c3dc370f..194a721b3 100644 --- a/app/logical/current_user.rb +++ b/app/logical/current_user.rb @@ -11,7 +11,6 @@ class CurrentUser ensure self.user = old_user self.ip_addr = old_ip_addr - self.mobile_mode = false end end @@ -49,14 +48,6 @@ class CurrentUser Thread.current[:current_ip_addr] end - def self.mobile_mode=(mode) - Thread.current[:mobile_mode] = mode - end - - def self.mobile_mode? - Thread.current[:mobile_mode] - end - def self.id if user.nil? nil diff --git a/app/models/post.rb b/app/models/post.rb index a89866f77..4aa4e9649 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -236,9 +236,7 @@ class Post < ApplicationRecord end def file_url_for(user) - if CurrentUser.mobile_mode? - large_file_url - elsif user.default_image_size == "large" && image_width > Danbooru.config.large_image_width + if user.default_image_size == "large" && image_width > Danbooru.config.large_image_width large_file_url else file_url @@ -246,9 +244,7 @@ class Post < ApplicationRecord end def file_path_for(user) - if CurrentUser.mobile_mode? - large_file_path - elsif user.default_image_size == "large" && image_width > Danbooru.config.large_image_width + if user.default_image_size == "large" && image_width > Danbooru.config.large_image_width large_file_path else file_path @@ -362,7 +358,7 @@ class Post < ApplicationRecord end def image_width_for(user) - if CurrentUser.mobile_mode? || user.default_image_size == "large" + if user.default_image_size == "large" large_image_width else image_width @@ -370,7 +366,7 @@ class Post < ApplicationRecord end def image_height_for(user) - if CurrentUser.mobile_mode? || user.default_image_size == "large" + if user.default_image_size == "large" large_image_height else image_height diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb index fb3441c89..76e92a703 100644 --- a/app/views/layouts/default.html.erb +++ b/app/views/layouts/default.html.erb @@ -23,7 +23,6 @@ - <%= content_tag(:meta, nil, name: "disable-mobile-gestures", content: CurrentUser.disable_mobile_gestures?) %>