aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionStackingView.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-07-19 14:42:39 -0400
committerbob <bcz@cs.brown.edu>2019-07-19 14:42:39 -0400
commitae07ba8fb410752ea98702219247ce5f89d1758b (patch)
tree0e4de37afccc8950648bf9c1d68207c460640a21 /src/client/views/collections/CollectionStackingView.tsx
parent2b98b5484b942361ab5e271fe9e09d09dc83fa60 (diff)
fixes for templates and stacking views
Diffstat (limited to 'src/client/views/collections/CollectionStackingView.tsx')
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index 4424cffe1..039bd7b3a 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -258,8 +258,9 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) {
let sectionFilter = StrCast(this.props.Document.sectionFilter);
let fields = new Map<object, Doc[]>();
sectionFilter && this.filteredChildren.map(d => {
- if (!fields.has(d[sectionFilter] as object)) fields.set(d[sectionFilter] as object, [d]);
- else fields.get(d[sectionFilter] as object)!.push(d);
+ let sectionValue = (d[sectionFilter] ? d[sectionFilter] : "-undefined-") as object;
+ if (!fields.has(sectionValue)) fields.set(sectionValue, [d]);
+ else fields.get(sectionValue)!.push(d);
});
return (
<div className="collectionStackingView"