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

View File

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

View File

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