From 4d14da35a4f5c8bfa857d4a6942f60eee2a42309 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 11 May 2023 18:13:13 +0800 Subject: [PATCH] More sort, still not perfect This proves to be more difficult than I thought --- src/utils/timeline-utils.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/timeline-utils.jsx b/src/utils/timeline-utils.jsx index e83ca5cf..b81af192 100644 --- a/src/utils/timeline-utils.jsx +++ b/src/utils/timeline-utils.jsx @@ -122,6 +122,8 @@ export function groupContext(items) { if (!a.inReplyToId && !b.inReplyToId) { return new Date(a.createdAt) - new Date(b.createdAt); } + if (a.inReplyToId === b.id) return 1; + if (b.inReplyToId === a.id) return -1; if (!a.inReplyToId) return -1; if (!b.inReplyToId) return 1; return new Date(a.createdAt) - new Date(b.createdAt);