mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
Auto-select space if joined whilst being viewed
This commit is contained in:
parent
62172ba43d
commit
a61f4c1811
@ -34,6 +34,7 @@ import {setHasDiff} from "../utils/sets";
|
||||
import {objectDiff} from "../utils/objects";
|
||||
import {arrayHasDiff} from "../utils/arrays";
|
||||
import {ISpaceSummaryEvent, ISpaceSummaryRoom} from "../components/structures/SpaceRoomDirectory";
|
||||
import RoomViewStore from "./RoomViewStore";
|
||||
|
||||
type SpaceKey = string | symbol;
|
||||
|
||||
@ -368,6 +369,11 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
||||
this.onRoomsUpdate();
|
||||
}
|
||||
|
||||
// if the user was looking at the room and then joined select that space
|
||||
if (room.getMyMembership() === "join" && room.roomId === RoomViewStore.getRoomId()) {
|
||||
this.setActiveSpace(room);
|
||||
}
|
||||
|
||||
const numSuggestedRooms = this._suggestedRooms.length;
|
||||
this._suggestedRooms = this._suggestedRooms.filter(r => r.room_id !== room.roomId);
|
||||
if (numSuggestedRooms !== this._suggestedRooms.length) {
|
||||
|
Loading…
Reference in New Issue
Block a user