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

Ensure incremental updates to the ImportanceAlgorithm trigger A-Z order
pull/21833/head
Travis Ralston 2020-07-21 14:28:46 -06:00 committed by GitHub
commit ba73ce16e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

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) {