2
0
mirror of https://github.com/frappe/books.git synced 2025-02-02 12:08:27 +00:00

fix: set default 0 in reduce

This commit is contained in:
18alantom 2022-08-23 16:46:40 +05:30
parent eadfd6f716
commit df3ad7b00d

View File

@ -418,7 +418,7 @@ export class Search {
const totalChildKeywords = Object.values(this.searchables)
.filter((s) => s.isChild)
.map((s) => this.keywords[s.schemaName]?.length ?? 0)
.reduce((a, b) => a + b);
.reduce((a, b) => a + b, 0);
if (totalChildKeywords > 2_000) {
this.set('skipTables', true);