From 0101dfcdfd9ebc57c96e2f0ae2b0f2fb5e631cd2 Mon Sep 17 00:00:00 2001 From: Z Date: Tue, 22 Oct 2019 12:52:18 +0800 Subject: [PATCH] fix bug --- app/controllers/api/v1/timelines/public_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/timelines/public_controller.rb b/app/controllers/api/v1/timelines/public_controller.rb index fcb770dc0..f9bc54c9a 100644 --- a/app/controllers/api/v1/timelines/public_controller.rb +++ b/app/controllers/api/v1/timelines/public_controller.rb @@ -18,10 +18,13 @@ class Api::V1::Timelines::PublicController < Api::BaseController end def load_statuses - (cached_0_pinned_statuses + cached_public_statuses).uniq { |p| p.id } + (cached_0_pinned_statuses + cached_public_statuses).uniq(&:id) end def cached_0_pinned_statuses + if not params_slice(:max_id, :since_id, :min_id).empty? + return [] + end z_pinned = Account.find(1).pinned_statuses cache_collection z_pinned, Status end