forked from mystiq/hydrogen-web
push to navigation in SessionViewModel rather than RVO
This commit is contained in:
parent
2c1b29e637
commit
b0d790543a
2 changed files with 4 additions and 1 deletions
|
@ -64,7 +64,7 @@ export class RoomViewModelObservable extends ObservableValue {
|
||||||
if (status & RoomStatus.BeingCreated) {
|
if (status & RoomStatus.BeingCreated) {
|
||||||
const {session} = this._sessionViewModel._client;
|
const {session} = this._sessionViewModel._client;
|
||||||
const roomBeingCreated = session.roomsBeingCreated.get(this.id);
|
const roomBeingCreated = session.roomsBeingCreated.get(this.id);
|
||||||
this._sessionViewModel.navigation.push("room", roomBeingCreated.roomId);
|
this._sessionViewModel.notifyRoomReplaced(roomBeingCreated.id, roomBeingCreated.roomId);
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Don't know how to replace a room with this status: " + (status ^ RoomStatus.Replaced));
|
throw new Error("Don't know how to replace a room with this status: " + (status ^ RoomStatus.Replaced));
|
||||||
}
|
}
|
||||||
|
|
|
@ -298,4 +298,7 @@ export class SessionViewModel extends ViewModel {
|
||||||
this.emitChange("rightPanelViewModel");
|
this.emitChange("rightPanelViewModel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
notifyRoomReplaced(oldId, newId) {
|
||||||
|
this.navigation.push("room", newId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue