Fix open room from search always open same space
This commit is contained in:
parent
715e6648ae
commit
76c16ce294
1 changed files with 13 additions and 5 deletions
|
@ -39,7 +39,7 @@ class Navigation extends EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
_mapRoomToSpace(roomId) {
|
_mapRoomToSpace(roomId) {
|
||||||
const { roomList } = this.initMatrix;
|
const { roomList, accountData } = this.initMatrix;
|
||||||
if (
|
if (
|
||||||
this.selectedTab === cons.tabs.HOME
|
this.selectedTab === cons.tabs.HOME
|
||||||
&& roomList.rooms.has(roomId)
|
&& roomList.rooms.has(roomId)
|
||||||
|
@ -61,14 +61,22 @@ class Navigation extends EventEmitter {
|
||||||
|
|
||||||
const parents = roomList.roomIdToParents.get(roomId);
|
const parents = roomList.roomIdToParents.get(roomId);
|
||||||
if (!parents) return;
|
if (!parents) return;
|
||||||
|
if (parents.has(this.selectedSpaceId)) {
|
||||||
[...parents].forEach((pId) => {
|
this.spaceToRoom.set(this.selectedSpaceId, {
|
||||||
this.spaceToRoom.set(pId, {
|
|
||||||
roomId,
|
roomId,
|
||||||
timestamp: Date.now(),
|
timestamp: Date.now(),
|
||||||
});
|
});
|
||||||
|
} else if (accountData.categorizedSpaces.has(this.selectedSpaceId)) {
|
||||||
|
const categories = roomList.getCategorizedSpaces([this.selectedSpaceId]);
|
||||||
|
const parent = [...parents].find((pId) => categories.has(pId));
|
||||||
|
if (parent) {
|
||||||
|
this.spaceToRoom.set(parent, {
|
||||||
|
roomId,
|
||||||
|
timestamp: Date.now(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_selectRoom(roomId, eventId) {
|
_selectRoom(roomId, eventId) {
|
||||||
const prevSelectedRoomId = this.selectedRoomId;
|
const prevSelectedRoomId = this.selectedRoomId;
|
||||||
|
|
Loading…
Reference in a new issue