anticipate non-found rooms

This commit is contained in:
Bruno Windels 2020-10-13 15:18:13 +02:00
parent 081820d8fb
commit afbfb0c82c
2 changed files with 8 additions and 2 deletions

View file

@ -132,7 +132,10 @@ export class RoomGridViewModel extends ViewModel {
this._viewModels[i] = this.disposeTracked(vm); this._viewModels[i] = this.disposeTracked(vm);
} }
if (newId) { if (newId) {
this._viewModels[i] = this.track(this._createRoomViewModel(newId)); const newVM = this._createRoomViewModel(newId);
if (newVM) {
this._viewModels[i] = this.track(newVM);
}
} }
changed = true; changed = true;
} }

View file

@ -122,7 +122,10 @@ export class SessionViewModel extends ViewModel {
if (vm) { if (vm) {
this._currentRoomViewModel = this.track(vm); this._currentRoomViewModel = this.track(vm);
} else { } else {
this._currentRoomViewModel = this.track(this._createRoomViewModel(currentRoomId.value)); const newVM = this._createRoomViewModel(currentRoomId.value);
if (newVM) {
this._currentRoomViewModel = this.track(newVM);
}
} }
} }
this._gridViewModel = this.disposeTracked(this._gridViewModel); this._gridViewModel = this.disposeTracked(this._gridViewModel);