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/nodes/WebBox.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx index bfe8782ac..a294125a5 100644 --- a/src/client/views/nodes/WebBox.tsx +++ b/src/client/views/nodes/WebBox.tsx @@ -8,7 +8,7 @@ import { Id } from "../../../fields/FieldSymbols"; import { HtmlField } from "../../../fields/HtmlField"; import { InkTool } from "../../../fields/InkField"; import { List } from "../../../fields/List"; -import { makeInterface } from "../../../fields/Schema"; +import { makeInterface, listSpec } from "../../../fields/Schema"; import { Cast, NumCast, StrCast } from "../../../fields/Types"; import { WebField } from "../../../fields/URLField"; import { TraceMobx } from "../../../fields/util"; @@ -282,8 +282,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 (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