From 86a1656949a1faa346b073fe0a68e3e856fbb09e Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 19 Mar 2021 23:31:59 -0400 Subject: fixing up future/history for webBox to sync annotation display. --- src/client/views/DocComponent.tsx | 4 ++-- src/client/views/nodes/WebBox.tsx | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index 86396dc4d..be1eab86b 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -84,7 +84,7 @@ export interface ViewBoxAnnotatableProps { } export function ViewBoxAnnotatableComponent

(schemaCtor: (doc: Doc) => T) { class Component extends Touchable

{ - _annotationKey: string = "annotations"; + @observable _annotationKey: string = "annotations"; @observable _isChildActive = false; //TODO This might be pretty inefficient if doc isn't observed, because computed doesn't cache then @@ -125,7 +125,7 @@ export function ViewBoxAnnotatableComponent

{ - const future = StrListCast(this.dataDoc[this.fieldKey + "-future"]); - const history = StrListCast(this.dataDoc[this.fieldKey + "-history"]); + const future = Cast(this.dataDoc[this.fieldKey + "-future"], listSpec("string"), []); + const history = Cast(this.dataDoc[this.fieldKey + "-history"], listSpec("string"), []); if (future.length) { history.push(this._url); this.dataDoc[this.fieldKey] = new WebField(new URL(this._url = future.pop()!)); @@ -295,8 +295,8 @@ export class WebBox extends ViewBoxAnnotatableComponent { - const future = StrListCast(this.dataDoc[this.fieldKey + "-future"]); - const history = StrListCast(this.dataDoc[this.fieldKey + "-history"]); + const future = Cast(this.dataDoc[this.fieldKey + "-future"], listSpec("string")); + const history = Cast(this.dataDoc[this.fieldKey + "-history"], listSpec("string"), []); if (history.length) { if (future === undefined) this.dataDoc[this.fieldKey + "-future"] = new List([this._url]); else future.push(this._url); @@ -316,8 +316,8 @@ export class WebBox extends ViewBoxAnnotatableComponent