diff options
author | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-03-17 21:56:41 -0400 |
---|---|---|
committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-03-17 21:56:41 -0400 |
commit | c4ca83acf90676abf2f822b4b0ff455fe50c0ddb (patch) | |
tree | 64f24440a4a6d58ac6998274c84a3e3b3db9234e /src/fields/Doc.ts | |
parent | 9c612838c775a6fa9737963618aeebbc427e794c (diff) | |
parent | 6f4f0ffb9f4ab816cf6055c62afc6f79b8e4961f (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into filters
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 2f9dc7f51..1c9ab0e7e 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -508,11 +508,11 @@ export namespace Doc { cloneMap.set(doc[Id], copy); if (LinkManager.Instance.getAllLinks().includes(doc) && LinkManager.Instance.getAllLinks().indexOf(copy) === -1) LinkManager.Instance.addLink(copy); const filter = [...exclusions, ...Cast(doc.cloneFieldFilter, listSpec("string"), [])]; - await Promise.all(Object.keys(doc).map(async key => { + await Promise.all([...Object.keys(doc), "links"].map(async key => { if (filter.includes(key)) return; const assignKey = (val: any) => !dontCreate && (copy[key] = val); const cfield = ComputedField.WithoutComputed(() => FieldValue(doc[key])); - const field = ProxyField.WithoutProxy(() => doc[key]); + const field = key === "links" && Doc.IsPrototype(doc) ? doc[key] : ProxyField.WithoutProxy(() => doc[key]); const copyObjectField = async (field: ObjectField) => { const list = Cast(doc[key], listSpec(Doc)); const docs = list && (await DocListCastAsync(list))?.filter(d => d instanceof Doc); |