matrix-public-archive/shared/viewmodels
Eric Eastwood c26bdc5ffb
Fix Firefox sorting room cards in the wrong direction (#261)
Room cards will now sort by room members descending (highest to lowest) as expected. 

Fix https://github.com/matrix-org/matrix-public-archive/issues/218

The `/publicRooms` (room directory) endpoint already returns rooms in the correct order which is why we didn't care about the order before but the different `[].sort(...)` implementations in browsers necessitates we be explicit about it. Ideally, we wouldn't have to use the `ObservableMap.sortValues()` method at all but it seems like one of the only ways to get the values out. In any case, maybe it's more clear what order things are in now.

This bug stems from the fact that `[1, 2, 3, 4, 5].sort((a, b) => 1)` returns different results in Chrome vs Firefox (found from https://stackoverflow.com/questions/55039157/array-sort-behaves-differently-in-firefox-and-chrome-edge)

 - Chrome: `[1, 2, 3, 4, 5].sort((a, b) => 1)` -> `[1, 2, 3, 4, 5]`  
 - Firefox: `[1, 2, 3, 4, 5].sort((a, b) => 1)` -> `[5, 4, 3, 2, 1]` 
2023-06-02 17:19:58 -05:00
..
ArchiveRoomViewModel.js Fix time selector showing when less than the page limit of messages (#213) 2023-05-04 20:50:43 -05:00
AvatarViewModel.js Add safe search filter for NSFW rooms (#208) 2023-05-03 04:45:33 -05:00
CalendarViewModel.js Add a way to select time of day (#139) 2023-04-05 04:25:31 -05:00
DeveloperOptionsContentViewModel.js Fix checkbox being checked by default when the value was actually `null` (#221) 2023-05-05 19:44:49 -05:00
HomeserverSelectionModalContentViewModel.js Add homeserver selector to room directory landing page (#87) 2022-10-20 02:06:43 -05:00
JumpToNextActivitySummaryTileViewModel.js Follow tombstone and predecessor history (#167) 2023-04-19 01:26:15 -05:00
JumpToPreviousActivitySummaryTileViewModel.js Follow tombstone and predecessor history (#167) 2023-04-19 01:26:15 -05:00
ModalViewModel.js Add support for room aliases (#107) 2022-10-27 01:09:13 -05:00
RoomCardViewModel.js Add safe search filter for NSFW rooms (#208) 2023-05-03 04:45:33 -05:00
RoomDirectoryViewModel.js Fix Firefox sorting room cards in the wrong direction (#261) 2023-06-02 17:19:58 -05:00
TimeSelectorViewModel.js Add a way to select time of day (#139) 2023-04-05 04:25:31 -05:00