Merge pull request #5031 from matrix-org/travis/room-list/a-z-order

Ensure incremental updates to the ImportanceAlgorithm trigger A-Z order
This commit is contained in:
Travis Ralston
2020-07-21 14:28:46 -06:00
committed by GitHub

View File

@@ -123,6 +123,7 @@ export class ImportanceAlgorithm extends OrderingAlgorithm {
const category = this.getRoomCategory(room);
this.alterCategoryPositionBy(category, 1, this.indices);
this.cachedOrderedRooms.splice(this.indices[category], 0, room); // splice in the new room (pre-adjusted)
await this.sortCategory(category);
} else if (cause === RoomUpdateCause.RoomRemoved) {
const roomIdx = this.getRoomIndex(room);
if (roomIdx === -1) {