aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionSubView.tsx
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2020-01-21 19:02:43 -0500
committerSam Wilkins <samwilkins333@gmail.com>2020-01-21 19:02:43 -0500
commit8a4a8212b024e2804596a08ea820be646c9a7c0f (patch)
treeb0b62819c892e729d5efa839f992dcd27857c20a /src/client/views/collections/CollectionSubView.tsx
parent74bad9d9deadeaf4959906e89457c16ed564fd01 (diff)
functional but incomplete updating logic
Diffstat (limited to 'src/client/views/collections/CollectionSubView.tsx')
-rw-r--r--src/client/views/collections/CollectionSubView.tsx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index 5f4ee3669..9357b0507 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -90,7 +90,15 @@ export function CollectionSubView<T>(schemaCtor: (doc: Doc) => T) {
// 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() {
- return this.props.annotationsKey ? (this.extensionDoc ? this.extensionDoc[this.props.annotationsKey] : undefined) : this.dataDoc[this.props.fieldKey];
+ const { annotationsKey, fieldKey } = this.props;
+ const { extensionDoc, dataDoc } = this;
+ if (annotationsKey) {
+ if (extensionDoc) {
+ return extensionDoc[annotationsKey];
+ }
+ return undefined;
+ }
+ return dataDoc[fieldKey];
}
get childLayoutPairs(): { layout: Doc; data: Doc; }[] {