Fix auto load room members

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2021-12-10 10:51:32 +05:30
parent 9365e5bfb9
commit 299ceac557
2 changed files with 3 additions and 1 deletions

View file

@ -61,7 +61,6 @@ function PeopleDrawer({ roomId }) {
const PER_PAGE_MEMBER = 50; const PER_PAGE_MEMBER = 50;
const mx = initMatrix.matrixClient; const mx = initMatrix.matrixClient;
const room = mx.getRoom(roomId); const room = mx.getRoom(roomId);
let isRoomChanged = false;
const [itemCount, setItemCount] = useState(PER_PAGE_MEMBER); const [itemCount, setItemCount] = useState(PER_PAGE_MEMBER);
const [membership, setMembership] = useState('join'); const [membership, setMembership] = useState('join');
@ -104,6 +103,7 @@ function PeopleDrawer({ roomId }) {
useEffect(() => { useEffect(() => {
let isGettingMembers = true; let isGettingMembers = true;
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?.event?.room_id !== roomId) return;

View file

@ -81,6 +81,8 @@ class RoomTimeline extends EventEmitter {
this.ongoingDecryptionCount = 0; this.ongoingDecryptionCount = 0;
this.initialized = false; this.initialized = false;
setTimeout(() => this.room.loadMembersIfNeeded());
// TODO: remove below line // TODO: remove below line
window.selectedRoom = this; window.selectedRoom = this;
} }