mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
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
@ -41,12 +41,13 @@ export class RoomViewModel extends ViewModel {
|
|||||||
async load() {
|
async load() {
|
||||||
this._room.on("change", this._onRoomChange);
|
this._room.on("change", this._onRoomChange);
|
||||||
try {
|
try {
|
||||||
this._timelineVM = this.track(new TimelineViewModel(this.childOptions({
|
const timelineVM = this.track(new TimelineViewModel(this.childOptions({
|
||||||
room: this._room,
|
room: this._room,
|
||||||
timeline: this._room.openTimeline(),
|
timeline: this._room.openTimeline(),
|
||||||
ownUserId: this._ownUserId,
|
ownUserId: this._ownUserId,
|
||||||
})));
|
})));
|
||||||
await this._timelineVM.load();
|
await timelineVM.load();
|
||||||
|
this._timelineVM = timelineVM;
|
||||||
this.emitChange("timelineViewModel");
|
this.emitChange("timelineViewModel");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(`room.openTimeline(): ${err.message}:\n${err.stack}`);
|
console.error(`room.openTimeline(): ${err.message}:\n${err.stack}`);
|
||||||
|
Loading…
Reference in New Issue
Block a user