pass vm field to emitChange

This commit is contained in:
Bruno Windels 2020-06-24 22:42:39 +02:00
parent 40c19f867a
commit e2c8b5e595
3 changed files with 3 additions and 5 deletions

View file

@ -20,10 +20,10 @@ export class SessionLoadViewModel extends ViewModel {
}
try {
this._loading = true;
this.emitChange();
this.emitChange("loading");
this._sessionContainer = this._createAndStartSessionContainer();
this._waitHandle = this._sessionContainer.loadStatus.waitFor(s => {
this.emitChange();
this.emitChange("loadLabel");
// wait for initial sync, but not catchup sync
const isCatchupSync = s === LoadStatus.FirstSync &&
this._sessionContainer.sync.status.get() === SyncStatus.CatchupSync;
@ -51,7 +51,7 @@ export class SessionLoadViewModel extends ViewModel {
this._error = err;
} finally {
this._loading = false;
this.emitChange();
this.emitChange("loading");
}
}

View file

@ -1,7 +1,6 @@
import {SimpleTile} from "./SimpleTile.js";
export class MessageTile extends SimpleTile {
constructor(options) {
super(options);
this._isOwn = this._entry.sender === options.ownUserId;

View file

@ -2,7 +2,6 @@ import {TemplateView} from "../../../general/TemplateView.js";
export class TextMessageView extends TemplateView {
render(t, vm) {
// no bindings ... should this be a template view?
return t.li(
{className: {"TextMessageView": true, own: vm.isOwn, pending: vm.isPending}},
t.div({className: "message-container"}, [