diff options
| author | bobzel <zzzman@gmail.com> | 2020-07-21 15:49:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-21 15:49:37 -0400 |
| commit | b4b817585995b4ce504564cb0601f34ed86fc4db (patch) | |
| tree | d10fe452916bf2a125ecd85b28171f9afb163a36 /src/client/views/collections/CollectionSubView.tsx | |
| parent | 2d0741800ed626ac3db2a8ac551904cbc0f7848e (diff) | |
| parent | 6b9a6fcd3c4e9bc63be11b820ad16be7495ed803 (diff) | |
Merge pull request #453 from browngraphicslab/acls_uv
ACLs for testing
Diffstat (limited to 'src/client/views/collections/CollectionSubView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionSubView.tsx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx index 3794088d4..8a3c2144e 100644 --- a/src/client/views/collections/CollectionSubView.tsx +++ b/src/client/views/collections/CollectionSubView.tsx @@ -91,6 +91,11 @@ export function CollectionSubView<T, X>(schemaCtor: (doc: Doc) => T, moreProps?: // to its children which may be templates. // If 'annotationField' is specified, then all children exist on that field of the extension document, otherwise, they exist directly on the data document under 'fieldKey' @computed get dataField() { + // sets the dataDoc's data field to an empty list if the data field is undefined - prevents issues with addonly + // setTimeout changes it outside of the @computed section + setTimeout(() => { + if (!this.dataDoc[this.props.annotationsKey || this.props.fieldKey]) this.dataDoc[this.props.annotationsKey || this.props.fieldKey] = new List<Doc>(); + }, 1000); return this.dataDoc[this.props.annotationsKey || this.props.fieldKey]; } @@ -418,4 +423,5 @@ import { FormattedTextBox, GoogleRef } from "../nodes/formattedText/FormattedTex import { CollectionView } from "./CollectionView"; import { SelectionManager } from "../../util/SelectionManager"; import { OverlayView } from "../OverlayView"; +import { setTimeout } from "timers"; |
