diff --git a/src/stores/SpaceStore.ts b/src/stores/SpaceStore.ts index 008d1107e7..6625e2117e 100644 --- a/src/stores/SpaceStore.ts +++ b/src/stores/SpaceStore.ts @@ -85,7 +85,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) => {