don't assign timelineVM before loaded, so prop doesn't return it
... if the binding happens to be evaluating (which it was during mount) follow-up from bwindels/fix-crash-switch-rooms-too-fast
This commit is contained in:
parent
f07b4a6554
commit
6bf8e976cb
1 changed files with 3 additions and 2 deletions
|
@ -41,12 +41,13 @@ export class RoomViewModel extends ViewModel {
|
|||
async load() {
|
||||
this._room.on("change", this._onRoomChange);
|
||||
try {
|
||||
this._timelineVM = this.track(new TimelineViewModel(this.childOptions({
|
||||
const timelineVM = this.track(new TimelineViewModel(this.childOptions({
|
||||
room: this._room,
|
||||
timeline: this._room.openTimeline(),
|
||||
ownUserId: this._ownUserId,
|
||||
})));
|
||||
await this._timelineVM.load();
|
||||
await timelineVM.load();
|
||||
this._timelineVM = timelineVM;
|
||||
this.emitChange("timelineViewModel");
|
||||
} catch (err) {
|
||||
console.error(`room.openTimeline(): ${err.message}:\n${err.stack}`);
|
||||
|
|
Reference in a new issue