From 299ceac557f67e18e458475146aa0d3519f99a26 Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Fri, 10 Dec 2021 10:51:32 +0530 Subject: [PATCH] Fix auto load room members Signed-off-by: Ajay Bura --- src/app/organisms/room/PeopleDrawer.jsx | 2 +- src/client/state/RoomTimeline.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/organisms/room/PeopleDrawer.jsx b/src/app/organisms/room/PeopleDrawer.jsx index 3e48b98..85992f7 100644 --- a/src/app/organisms/room/PeopleDrawer.jsx +++ b/src/app/organisms/room/PeopleDrawer.jsx @@ -61,7 +61,6 @@ function PeopleDrawer({ roomId }) { const PER_PAGE_MEMBER = 50; const mx = initMatrix.matrixClient; const room = mx.getRoom(roomId); - let isRoomChanged = false; const [itemCount, setItemCount] = useState(PER_PAGE_MEMBER); const [membership, setMembership] = useState('join'); @@ -104,6 +103,7 @@ function PeopleDrawer({ roomId }) { useEffect(() => { let isGettingMembers = true; + let isRoomChanged = false; const updateMemberList = (event) => { if (isGettingMembers) return; if (event && event?.event?.room_id !== roomId) return; diff --git a/src/client/state/RoomTimeline.js b/src/client/state/RoomTimeline.js index b6a5c14..24e1b2e 100644 --- a/src/client/state/RoomTimeline.js +++ b/src/client/state/RoomTimeline.js @@ -81,6 +81,8 @@ class RoomTimeline extends EventEmitter { this.ongoingDecryptionCount = 0; this.initialized = false; + setTimeout(() => this.room.loadMembersIfNeeded()); + // TODO: remove below line window.selectedRoom = this; }