Fix space store wrongly switching to a non-space filter
parent
853b218d8a
commit
bf33775a14
|
@ -376,16 +376,16 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
this.onRoomsUpdate();
|
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (room.getMyMembership() === "join") {
|
if (room.getMyMembership() === "join") {
|
||||||
const numSuggestedRooms = this._suggestedRooms.length;
|
if (!room.isSpaceRoom()) {
|
||||||
this._suggestedRooms = this._suggestedRooms.filter(r => r.room_id !== room.roomId);
|
const numSuggestedRooms = this._suggestedRooms.length;
|
||||||
if (numSuggestedRooms !== this._suggestedRooms.length) {
|
this._suggestedRooms = this._suggestedRooms.filter(r => r.room_id !== room.roomId);
|
||||||
this.emit(SUGGESTED_ROOMS, this._suggestedRooms);
|
if (numSuggestedRooms !== this._suggestedRooms.length) {
|
||||||
|
this.emit(SUGGESTED_ROOMS, this._suggestedRooms);
|
||||||
|
}
|
||||||
|
} else if (room.roomId === RoomViewStore.getRoomId()) {
|
||||||
|
// if the user was looking at the space and then joined: select that space
|
||||||
|
this.setActiveSpace(room);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue