From 17f1fdaf6d3192c7c1009f694c66fa5cbec04bd7 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 16 Jun 2020 10:59:42 -0600 Subject: [PATCH] Include the sticky room when filtering in the new room list Fixes https://github.com/vector-im/riot-web/issues/14050 --- src/stores/room-list/algorithms/Algorithm.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts index e8b167c1ba..a89167095d 100644 --- a/src/stores/room-list/algorithms/Algorithm.ts +++ b/src/stores/room-list/algorithms/Algorithm.ts @@ -230,7 +230,10 @@ export class Algorithm extends EventEmitter { // Cheaply clone the rooms so we can more easily do operations on the list. // We optimize our lookups by trying to reduce sample size as much as possible // to the rooms we know will be deduped by the Set. - const rooms = this.cachedRooms[tagId]; + const rooms = this.cachedRooms[tagId].map(r => r); // cheap clone + if (this._stickyRoom && this._stickyRoom.tag === tagId && this._stickyRoom.room) { + rooms.push(this._stickyRoom.room); + } let remainingRooms = rooms.map(r => r); let allowedRoomsInThisTag = []; let lastFilterPriority = orderedFilters[0].relativePriority;