aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocComponent.tsx
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2021-09-23 15:09:32 -0400
committerGitHub <noreply@github.com>2021-09-23 15:09:32 -0400
commit281ea90236adb8cb3ff8db7ddc76a466a8641bcd (patch)
treebe9a5086596e33c269857c9ead0293719786035e /src/client/views/DocComponent.tsx
parent26e265c6fc4950b859724aa2c0fbe6a028a56bfc (diff)
parentd5f9533d153e11e24d2ab7c03b4561170f0768fe (diff)
Merge branch 'master' into linking-anh
Diffstat (limited to 'src/client/views/DocComponent.tsx')
-rw-r--r--src/client/views/DocComponent.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx
index 33dff9da5..32c351bf5 100644
--- a/src/client/views/DocComponent.tsx
+++ b/src/client/views/DocComponent.tsx
@@ -115,7 +115,7 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps, T
const style: { [key: string]: any } = {};
const divKeys = ["width", "height", "fontSize", "transform", "left", "background", "left", "right", "top", "bottom", "pointerEvents", "position"];
const replacer = (match: any, expr: string, offset: any, string: any) => { // bcz: this executes a script to convert a property expression string: { script } into a value
- return ScriptField.MakeFunction(expr, { self: Doc.name, this: Doc.name, scale: "number" })?.script.run({ self: this.rootDoc, this: this.layoutDoc, scale }).result as string || "";
+ return ScriptField.MakeFunction(expr, { self: Doc.name, this: Doc.name, scale: "number" })?.script.run({ self: this.rootDoc, this: this.layoutDoc, scale }).result?.toString() ?? "";
};
divKeys.map((prop: string) => {
const p = (this.props as any)[prop];
@@ -176,7 +176,7 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps, T
return false;
}
@action.bound
- addDocument(doc: Doc | Doc[], annotationKey?: string): boolean {
+ addDocument = (doc: Doc | Doc[], annotationKey?: string): boolean => {
const docs = doc instanceof Doc ? [doc] : doc;
if (this.props.filterAddDocument?.(docs) === false ||
docs.find(doc => Doc.AreProtosEqual(doc, this.props.Document) && Doc.LayoutField(doc) === Doc.LayoutField(this.props.Document))) {