Fix room remain selected on leave
This commit is contained in:
parent
8b52c3cfff
commit
a5878e9de6
2 changed files with 11 additions and 1 deletions
|
@ -4,6 +4,16 @@ import { selectTab, selectSpace, selectRoom } from '../action/navigation';
|
||||||
|
|
||||||
function initRoomListListener(roomList) {
|
function initRoomListListener(roomList) {
|
||||||
const listenRoomLeave = (roomId) => {
|
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) {
|
if (navigation.selectedRoomId === roomId) {
|
||||||
selectRoom(null);
|
selectRoom(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -282,7 +282,7 @@ class Navigation extends EventEmitter {
|
||||||
this._selectSpace(action.roomId, false);
|
this._selectSpace(action.roomId, false);
|
||||||
},
|
},
|
||||||
[cons.actions.navigation.SELECT_ROOM]: () => {
|
[cons.actions.navigation.SELECT_ROOM]: () => {
|
||||||
this._selectTabWithRoom(action.roomId);
|
if (action.roomId) this._selectTabWithRoom(action.roomId);
|
||||||
this._selectRoom(action.roomId, action.eventId);
|
this._selectRoom(action.roomId, action.eventId);
|
||||||
},
|
},
|
||||||
[cons.actions.navigation.OPEN_SPACE_SETTINGS]: () => {
|
[cons.actions.navigation.OPEN_SPACE_SETTINGS]: () => {
|
||||||
|
|
Loading…
Reference in a new issue