Fix bug in room hierarchy
authorajbura <ajbura@gmail.com>
Wed, 16 Feb 2022 14:20:11 +0000 (19:50 +0530)
committerajbura <ajbura@gmail.com>
Wed, 16 Feb 2022 14:20:11 +0000 (19:50 +0530)
Signed-off-by: ajbura <ajbura@gmail.com>
src/client/state/RoomsHierarchy.js

index ce1036c0a400443c26eae2c517dbd2953d3e9eb7..f3ffb1fcb2585ad74a985000c53c4f57f7c031c8 100644 (file)
@@ -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);
     }