Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit ed9d006

Browse files
authored
Merge pull request #6939 from matrix-org/dbkr/fix_room_list_on_unsent_message
Fix bug where room list would get stuck showing no rooms
2 parents 15076ce + c2ed27a commit ed9d006

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ interface ICategoryIndex {
3737
// comments! Check the usage of Category carefully to figure out what needs changing
3838
// if you're going to change this array's order.
3939
const CATEGORY_ORDER = [
40+
NotificationColor.Unsent,
4041
NotificationColor.Red,
4142
NotificationColor.Grey,
4243
NotificationColor.Bold,
@@ -50,9 +51,10 @@ const CATEGORY_ORDER = [
5051
* interfere with this algorithm, however manual ordering does.
5152
*
5253
* The importance of a room is defined by the kind of notifications, if any, are
53-
* present on the room. These are classified internally as Red, Grey, Bold, and
54-
* Idle. Red rooms have mentions, grey have unread messages, bold is a less noisy
55-
* version of grey, and idle means all activity has been seen by the user.
54+
* present on the room. These are classified internally as Unsent, Red, Grey,
55+
* Bold, and Idle. 'Unsent' rooms have unsent messages, Red rooms have mentions,
56+
* grey have unread messages, bold is a less noisy version of grey, and idle
57+
* means all activity has been seen by the user.
5658
*
5759
* The algorithm works by monitoring all room changes, including new messages in
5860
* tracked rooms, to determine if it needs a new category or different placement
@@ -74,6 +76,7 @@ export class ImportanceAlgorithm extends OrderingAlgorithm {
7476
// noinspection JSMethodCanBeStatic
7577
private categorizeRooms(rooms: Room[]): ICategorizedRoomMap {
7678
const map: ICategorizedRoomMap = {
79+
[NotificationColor.Unsent]: [],
7780
[NotificationColor.Red]: [],
7881
[NotificationColor.Grey]: [],
7982
[NotificationColor.Bold]: [],

0 commit comments

Comments
 (0)