From 76cb52878c5afa2b9d7388ea389f18842838c5dc Mon Sep 17 00:00:00 2001 From: ajbura Date: Wed, 16 Feb 2022 19:50:11 +0530 Subject: [PATCH] Fix bug in room hierarchy Signed-off-by: ajbura --- src/client/state/RoomsHierarchy.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/client/state/RoomsHierarchy.js b/src/client/state/RoomsHierarchy.js index ce1036c..f3ffb1f 100644 --- a/src/client/state/RoomsHierarchy.js +++ b/src/client/state/RoomsHierarchy.js @@ -28,9 +28,12 @@ class RoomsHierarchy { let roomHierarchy = this.getHierarchy(roomId); if (!roomHierarchy) { - const room = this.matrixClient.getRoom(roomId); - if (!room) return null; - roomHierarchy = new RoomHierarchy(room, limit, this._maxDepth, this._suggestedOnly); + roomHierarchy = new RoomHierarchy( + { roomId, client: this.matrixClient }, + limit, + this._maxDepth, + this._suggestedOnly, + ); this.roomIdToHierarchy.set(roomId, roomHierarchy); }