From b7fac8bcbce5299b3b86cc5d970876a734b4806d Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Wed, 12 Jan 2022 13:57:47 +0530 Subject: [PATCH] Update people drawer on power level change Signed-off-by: Ajay Bura --- src/app/organisms/room/PeopleDrawer.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/organisms/room/PeopleDrawer.jsx b/src/app/organisms/room/PeopleDrawer.jsx index 2ab9976..026173d 100644 --- a/src/app/organisms/room/PeopleDrawer.jsx +++ b/src/app/organisms/room/PeopleDrawer.jsx @@ -107,7 +107,7 @@ function PeopleDrawer({ roomId }) { let isRoomChanged = false; const updateMemberList = (event) => { if (isGettingMembers) return; - if (event && event?.event?.room_id !== roomId) return; + if (event && event?.getRoomId() !== roomId) return; setMemberList( simplyfiMembers( getMembersWithMembership(membership) @@ -125,6 +125,7 @@ function PeopleDrawer({ roomId }) { asyncSearch.on(asyncSearch.RESULT_SENT, handleSearchData); mx.on('RoomMember.membership', updateMemberList); + mx.on('RoomMember.powerLevel', updateMemberList); return () => { isRoomChanged = true; setMemberList([]); @@ -132,6 +133,7 @@ function PeopleDrawer({ roomId }) { setItemCount(PER_PAGE_MEMBER); asyncSearch.removeListener(asyncSearch.RESULT_SENT, handleSearchData); mx.removeListener('RoomMember.membership', updateMemberList); + mx.removeListener('RoomMember.powerLevel', updateMemberList); }; }, [roomId, membership]);