aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-05-04 11:46:14 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-05-04 11:46:14 -0400
commitc11e1df91c7b2dedd465b56fd8ae4e353f4fc240 (patch)
tree830c29a350d955b40c74784fef5a6c13cc158563 /src
parenta41092feaf9e5777a538371ded3c8d88e58a3d90 (diff)
fixed links with deep clone
Diffstat (limited to 'src')
-rw-r--r--src/new_fields/Doc.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts
index 9efb14d03..9f75b5ffe 100644
--- a/src/new_fields/Doc.ts
+++ b/src/new_fields/Doc.ts
@@ -19,6 +19,7 @@ import { Cast, FieldValue, NumCast, StrCast, ToConstructor, ScriptCast } from ".
import { deleteProperty, getField, getter, makeEditable, makeReadOnly, setter, updateFunction } from "./util";
import { Docs, DocumentOptions } from "../client/documents/Documents";
import { PdfField, VideoField, AudioField, ImageField } from "./URLField";
+import { LinkManager } from "../client/util/LinkManager";
export namespace Field {
export function toKeyValueString(doc: Doc, key: string): string {
@@ -589,6 +590,7 @@ export namespace Doc {
if (cloneMap.get(doc)) return cloneMap.get(doc)!;
const copy = new Doc(undefined, true);
cloneMap.set(doc, copy);
+ if (LinkManager.Instance.getAllLinks().includes(doc)) LinkManager.Instance.addLink(copy);
const exclude = Cast(doc.excludeFields, listSpec("string"), []);
Object.keys(doc).forEach(key => {
if (exclude.includes(key)) return;