From d70a57a7c93f42e0147ee2e026729863a1f4ff46 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 4 May 2020 22:24:49 +0200 Subject: [PATCH] remove support for observablevalues from templateview it's not used, and so params haven't been standardized trying to unify it, it messes up overriding update in RoomView that extends it to set the timelineViewModel upon update. --- src/ui/web/general/TemplateView.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/ui/web/general/TemplateView.js b/src/ui/web/general/TemplateView.js index 01480668..e557e2b3 100644 --- a/src/ui/web/general/TemplateView.js +++ b/src/ui/web/general/TemplateView.js @@ -40,14 +40,10 @@ export class TemplateView { } _subscribe() { - this._boundUpdateFromValue = this._updateFromValue.bind(this); - if (typeof this._value.on === "function") { + this._boundUpdateFromValue = this._updateFromValue.bind(this); this._value.on("change", this._boundUpdateFromValue); } - else if (typeof this._value.subscribe === "function") { - this._value.subscribe(this._boundUpdateFromValue); - } } _unsubscribe() { @@ -55,9 +51,6 @@ export class TemplateView { if (typeof this._value.off === "function") { this._value.off("change", this._boundUpdateFromValue); } - else if (typeof this._value.unsubscribe === "function") { - this._value.unsubscribe(this._boundUpdateFromValue); - } this._boundUpdateFromValue = null; } } @@ -103,17 +96,14 @@ export class TemplateView { v.unmount(); } } - if (typeof this._value.dispose === "function") { - this._value.dispose(); - } } root() { return this._root; } - _updateFromValue() { - this.update(this._value); + _updateFromValue(changedProps) { + this.update(this._value, changedProps); } update(value) {