mirror of https://github.com/vector-im/riot-web
Fix automatic space switching behaviour to prioritise canonical parents
parent
4446022327
commit
f5ab75cfdd
|
@ -540,15 +540,12 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
// as this is not helpful and can create loops of rooms/space switching
|
// as this is not helpful and can create loops of rooms/space switching
|
||||||
if (!room || payload.context_switch) break;
|
if (!room || payload.context_switch) break;
|
||||||
|
|
||||||
// persist last viewed room from a space
|
|
||||||
|
|
||||||
if (room.isSpaceRoom()) {
|
if (room.isSpaceRoom()) {
|
||||||
this.setActiveSpace(room);
|
this.setActiveSpace(room);
|
||||||
} else if (!this.getSpaceFilteredRoomIds(this.activeSpace).has(room.roomId)) {
|
} else if (!this.getSpaceFilteredRoomIds(this.activeSpace).has(room.roomId)) {
|
||||||
// TODO maybe reverse these first 2 clauses once space panel active is fixed
|
let parent = this.getCanonicalParent(room.roomId);
|
||||||
let parent = this.rootSpaces.find(s => this.spaceFilteredRooms.get(s.roomId)?.has(room.roomId));
|
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
parent = this.getCanonicalParent(room.roomId);
|
parent = this.rootSpaces.find(s => this.spaceFilteredRooms.get(s.roomId)?.has(room.roomId));
|
||||||
}
|
}
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
const parents = Array.from(this.parentMap.get(room.roomId) || []);
|
const parents = Array.from(this.parentMap.get(room.roomId) || []);
|
||||||
|
|
Loading…
Reference in New Issue