A platform for community discussion. Free, open, simple.
FIX: remove slow platform detection from server side
Sam94b8ba4f8ff7
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rbindex 9cec48c193a..846ffc2c5fc 100644--- a/app/controllers/application_controller.rb+++ b/app/controllers/application_controller.rb@@ -101,10 +101,6 @@ class ApplicationController < ActionController::Baseendend- def slow_platform?- request.user_agent =~ /Android/- end-def set_layoutuse_crawler_layout? ? 'crawler' : 'application'enddiff --git a/app/controllers/list_controller.rb b/app/controllers/list_controller.rbindex d52f1ee4bea..2076d0a9d8c 100644--- a/app/controllers/list_controller.rb+++ b/app/controllers/list_controller.rb@@ -383,7 +383,6 @@ class ListController < ApplicationController# hacky columns get special handlingoptions[:topic_ids] = param_to_integer_list(:topic_ids)options[:no_subcategories] = options[:no_subcategories] == 'true'- options[:slow_platform] = slow_platform?optionsenddiff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rbindex 624eff5fb36..2c02fc71e38 100644--- a/app/controllers/tags_controller.rb+++ b/app/controllers/tags_controller.rb@@ -351,7 +351,6 @@ class TagsController < ::ApplicationControllerq: params[:q]}options[:no_subcategories] = true if params[:no_subcategories] == 'true'- options[:slow_platform] = true if slow_platform?if params[:tag_id] == 'none'options[:no_tags] = truediff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rbindex a8e4822d197..e022dd70eac 100644--- a/app/controllers/topics_controller.rb+++ b/app/controllers/topics_controller.rb@@ -64,7 +64,6 @@ class TopicsController < ApplicationControlleropts = params.slice(:username_filters, :filter, :page, :post_number, :show_deleted)username_filters = opts[:username_filters]- opts[:slow_platform] = true if slow_platform?opts[:print] = true if params[:print].present?opts[:username_filters] = username_filters.split(',') if username_filters.is_a?(String)diff --git a/lib/topic_query.rb b/lib/topic_query.rbindex 0e48e34eef8..e1934f85093 100644--- a/lib/topic_query.rb+++ b/lib/topic_query.rb@@ -67,7 +67,6 @@ class TopicQuerytagsmatch_all_tagsno_subcategories- slow_platformno_tags)end@@ -495,7 +494,7 @@ class TopicQueryprotecteddef per_page_setting- @options[:slow_platform] ? 15 : 30+ 30enddef private_messages_for(user, type)diff --git a/lib/topic_view.rb b/lib/topic_view.rbindex 21fbe758745..059b111bbc4 100644--- a/lib/topic_view.rb+++ b/lib/topic_view.rb@@ -9,10 +9,6 @@ class TopicViewattr_reader :topic, :posts, :guardian, :filtered_posts, :chunk_size, :print, :message_bus_last_idattr_accessor :draft, :draft_key, :draft_sequence, :user_custom_fields, :post_custom_fields, :post_number- def self.slow_chunk_size- 10- end-def self.print_chunk_size1000end@@ -57,7 +53,6 @@ class TopicView@chunk_size =case- when options[:slow_platform] then TopicView.slow_chunk_sizewhen @print then TopicView.print_chunk_sizeelse TopicView.chunk_sizeenddiff --git a/spec/components/topic_view_spec.rb b/spec/components/topic_view_spec.rbindex 6dc6bc72c75..44ed4df41d9 100644--- a/spec/components/topic_view_spec.rb+++ b/spec/components/topic_view_spec.rb@@ -36,11 +36,6 @@ describe TopicView doexpect(TopicView.new(topic.id, evil_trout).chunk_size).to eq(TopicView.chunk_size)end- it "returns `slow_chunk_size` when slow_platform is true" do- tv = TopicView.new(topic.id, evil_trout, slow_platform: true)- expect(tv.chunk_size).to eq(TopicView.slow_chunk_size)- end-it "returns `print_chunk_size` when print param is true" dotv = TopicView.new(topic.id, evil_trout, print: true)expect(tv.chunk_size).to eq(TopicView.print_chunk_size)