From d7c43c7cf8b5a9701ab7003b7c7e4c9bc3fa5171 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 28 Sep 2021 15:37:57 +0100 Subject: [PATCH] Fix space children without specific `order` being sorted after those with one --- src/stores/SpaceStore.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/SpaceStore.tsx b/src/stores/SpaceStore.tsx index d440c33c83..73feb300a5 100644 --- a/src/stores/SpaceStore.tsx +++ b/src/stores/SpaceStore.tsx @@ -93,7 +93,7 @@ const validOrder = (order: string): string | undefined => { // For sorting space children using a validated `order`, `m.room.create`'s `origin_server_ts`, `room_id` export const getChildOrder = (order: string, creationTs: number, roomId: string): Array>> => { - return [validOrder(order), creationTs, roomId]; + return [validOrder(order) ?? NaN, creationTs, roomId]; // NaN has lodash sort it at the end in asc }; const getRoomFn: FetchRoomFn = (room: Room) => {