Update people drawer on power level change
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
12f2eed5b3
commit
b7fac8bcbc
1 changed files with 3 additions and 1 deletions
|
@ -107,7 +107,7 @@ function PeopleDrawer({ roomId }) {
|
||||||
let isRoomChanged = false;
|
let isRoomChanged = false;
|
||||||
const updateMemberList = (event) => {
|
const updateMemberList = (event) => {
|
||||||
if (isGettingMembers) return;
|
if (isGettingMembers) return;
|
||||||
if (event && event?.event?.room_id !== roomId) return;
|
if (event && event?.getRoomId() !== roomId) return;
|
||||||
setMemberList(
|
setMemberList(
|
||||||
simplyfiMembers(
|
simplyfiMembers(
|
||||||
getMembersWithMembership(membership)
|
getMembersWithMembership(membership)
|
||||||
|
@ -125,6 +125,7 @@ function PeopleDrawer({ roomId }) {
|
||||||
|
|
||||||
asyncSearch.on(asyncSearch.RESULT_SENT, handleSearchData);
|
asyncSearch.on(asyncSearch.RESULT_SENT, handleSearchData);
|
||||||
mx.on('RoomMember.membership', updateMemberList);
|
mx.on('RoomMember.membership', updateMemberList);
|
||||||
|
mx.on('RoomMember.powerLevel', updateMemberList);
|
||||||
return () => {
|
return () => {
|
||||||
isRoomChanged = true;
|
isRoomChanged = true;
|
||||||
setMemberList([]);
|
setMemberList([]);
|
||||||
|
@ -132,6 +133,7 @@ function PeopleDrawer({ roomId }) {
|
||||||
setItemCount(PER_PAGE_MEMBER);
|
setItemCount(PER_PAGE_MEMBER);
|
||||||
asyncSearch.removeListener(asyncSearch.RESULT_SENT, handleSearchData);
|
asyncSearch.removeListener(asyncSearch.RESULT_SENT, handleSearchData);
|
||||||
mx.removeListener('RoomMember.membership', updateMemberList);
|
mx.removeListener('RoomMember.membership', updateMemberList);
|
||||||
|
mx.removeListener('RoomMember.powerLevel', updateMemberList);
|
||||||
};
|
};
|
||||||
}, [roomId, membership]);
|
}, [roomId, membership]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue