Fix leaved room appear in category & search
This commit is contained in:
parent
a5878e9de6
commit
e801aa538d
2 changed files with 4 additions and 1 deletions
|
@ -5,6 +5,7 @@ import { selectTab, selectSpace, selectRoom } from '../action/navigation';
|
|||
function initRoomListListener(roomList) {
|
||||
const listenRoomLeave = (roomId) => {
|
||||
const parents = roomList.roomIdToParents.get(roomId);
|
||||
|
||||
if (parents) {
|
||||
[...parents].forEach((pId) => {
|
||||
const data = navigation.spaceToRoom.get(pId);
|
||||
|
@ -23,6 +24,8 @@ function initRoomListListener(roomList) {
|
|||
if (idIndex === 0) selectTab(cons.tabs.HOME);
|
||||
else selectSpace(navigation.selectedSpacePath[idIndex - 1]);
|
||||
}
|
||||
|
||||
navigation.removeRecentRoom(roomId);
|
||||
};
|
||||
|
||||
roomList.on(cons.events.roomList.ROOM_LEAVED, listenRoomLeave);
|
||||
|
|
|
@ -89,7 +89,7 @@ class RoomList extends EventEmitter {
|
|||
|
||||
child.forEach((childId) => {
|
||||
const room = this.matrixClient.getRoom(childId);
|
||||
if (room === null) return;
|
||||
if (room === null || room.getMyMembership() !== 'join') return;
|
||||
if (room.isSpaceRoom()) categorizeSpace(childId);
|
||||
else mappedChild.add(childId);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue