aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionSubView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-08-20 12:12:19 -0400
committerbobzel <zzzman@gmail.com>2020-08-20 12:12:19 -0400
commitaa626240bff72456dccc7f91e433135e393cb161 (patch)
tree206143234c9994125a10492884cda41fb27b407b /src/client/views/collections/CollectionSubView.tsx
parentc4c9c2e7ec10e19ee9fe9c0c93c4d7fe61328171 (diff)
more searchBox fixes.
Diffstat (limited to 'src/client/views/collections/CollectionSubView.tsx')
-rw-r--r--src/client/views/collections/CollectionSubView.tsx23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index 075be41fd..a1dd905c2 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -138,37 +138,24 @@ export function CollectionSubView<T, X>(schemaCtor: (doc: Doc) => T, moreProps?:
const docRangeFilters = this.props.ignoreFields?.includes("_docRangeFilters") ? [] : Cast(this.props.Document._docRangeFilters, listSpec("string"), []);
console.log(searchDocs);
searchDocs = DocUtils.FilterDocs(searchDocs, this.docFilters(), docRangeFilters, viewSpecScript);
- console.log(this.docFilters());
- console.log(searchDocs);
childDocs.forEach((d) => {
if (d.data !== undefined) {
let newdocs = DocListCast(d.data);
if (newdocs.length > 0) {
- let displaycheck: boolean | undefined = undefined;
+ let displaycheck = false;
let newarray: Doc[] = [];
while (newdocs.length > 0) {
newarray = [];
newdocs.forEach((t) => {
- if (d.data !== undefined) {
- const newdocs = DocListCast(t.data);
- newdocs.forEach((newdoc) => {
- newarray.push(newdoc);
- });
- }
- if (searchDocs.includes(t)) {
- displaycheck = true;
- }
+ DocListCast(t.data).forEach((newdoc) => newarray.push(newdoc));
+ displaycheck = displaycheck || searchDocs.includes(t);
});
newdocs = newarray;
}
- if (displaycheck === true) {
- docsforFilter.push(d);
- }
+ displaycheck && docsforFilter.push(d);
}
}
- if (searchDocs.includes(d)) {
- docsforFilter.push(d);
- }
+ searchDocs.includes(d) && docsforFilter.push(d);
});
return docsforFilter;
}