Fix room remain selected on leave

This commit is contained in:
Ajay Bura 2022-08-20 13:12:29 +05:30
parent 8b52c3cfff
commit a5878e9de6
2 changed files with 11 additions and 1 deletions

View file

@ -4,6 +4,16 @@ 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);
if (data?.roomId === roomId) {
navigation.spaceToRoom.delete(pId);
}
});
}
if (navigation.selectedRoomId === roomId) {
selectRoom(null);
}

View file

@ -282,7 +282,7 @@ class Navigation extends EventEmitter {
this._selectSpace(action.roomId, false);
},
[cons.actions.navigation.SELECT_ROOM]: () => {
this._selectTabWithRoom(action.roomId);
if (action.roomId) this._selectTabWithRoom(action.roomId);
this._selectRoom(action.roomId, action.eventId);
},
[cons.actions.navigation.OPEN_SPACE_SETTINGS]: () => {