1
0
Fork 0

More sort, still not perfect

This proves to be more difficult than I thought
This commit is contained in:
Lim Chee Aun 2023-05-11 18:13:13 +08:00
parent edf7f6039c
commit 4d14da35a4

View file

@ -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);