From 53fa59f5a4fc068f9a5b79e3e57b8ccac3a8e7de Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 15 Feb 2019 23:40:23 -0700 Subject: [PATCH] Remove old debugging code The algorithm is correctly applied when these are removed. --- src/stores/RoomListStore.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stores/RoomListStore.js b/src/stores/RoomListStore.js index 9a764cd493..b998476cc5 100644 --- a/src/stores/RoomListStore.js +++ b/src/stores/RoomListStore.js @@ -276,7 +276,7 @@ class RoomListStore extends Store { for (const key of Object.keys(this._state.lists)) { listsClone[key] = []; let pushedEntry = false; - const hasRoom = !!this._state.lists[key].find((e) => e.room.roomId === room.roomId); + const hasRoom = this._state.lists[key].some((e) => e.room.roomId === room.roomId); // We track where the boundary within listsClone[key] is just in case our timestamp // ordering fails. If we can't stick the room in at the correct place in the category @@ -305,8 +305,8 @@ class RoomListStore extends Store { // based on most recent timestamp. const changedBoundary = entryCategoryIndex > targetCategoryIndex; const currentCategory = entryCategoryIndex === targetCategoryIndex; - if (changedBoundary || (false && currentCategory && targetTimestamp >= entryTimestamp)) { - if (changedBoundary && false) { + if (changedBoundary || (currentCategory && targetTimestamp >= entryTimestamp)) { + if (changedBoundary) { // If we changed a boundary, then we've gone too far - go to the top of the last // section instead. listsClone[key].splice(desiredCategoryBoundaryIndex, 0, {room, category});