From 770c77ee812af4d8f77353df9b7c2f309e2b305a Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Sat, 7 May 2022 12:48:34 +0900 Subject: [PATCH] Move local feed before federated feed for non-logged-in users --- plume-models/src/timeline/mod.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plume-models/src/timeline/mod.rs b/plume-models/src/timeline/mod.rs index e1f4c2e2..2bc87021 100644 --- a/plume-models/src/timeline/mod.rs +++ b/plume-models/src/timeline/mod.rs @@ -86,16 +86,6 @@ impl Timeline { .or(timeline_definition::user_id.is_null()), ) .load::(conn) - .map(|mut timelines| { - timelines.sort_by(|t1, t2| { - if t1.user_id.is_some() && t2.user_id.is_none() { - Ordering::Less - } else { - t1.id.cmp(&t2.id) - } - }); - timelines - }) .map_err(Error::from) } else { timeline_definition::table @@ -103,6 +93,16 @@ impl Timeline { .load::(conn) .map_err(Error::from) } + .map(|mut timelines| { + timelines.sort_by(|t1, t2| { + if t1.user_id.is_some() && t2.user_id.is_none() { + Ordering::Less + } else { + t1.id.cmp(&t2.id) + } + }); + timelines + }) } pub fn new_for_user(