[web] Fix shadowed variables

This commit is contained in:
Alain Nussbaumer
2024-04-26 21:48:07 +02:00
parent 8a303f340b
commit 7826b36634
4 changed files with 9 additions and 15 deletions

View File

@@ -80,7 +80,6 @@ export class GroupedList {
}
group({ criteria = [], filters = [], index } = {}) {
const indexer = createIndexer(index)
const itemsFiltered = this.items.filter((item) =>
filters.every((filter) => filter(item))
)
@@ -94,9 +93,10 @@ export class GroupedList {
)
)
// Group item list
const indexer = createIndexer(index)
this.itemsGrouped = itemsSorted.reduce((map, item) => {
const index = indexer(item)
map.set(index, [...(map.get(index) || []), item])
const key = indexer(item)
map.set(key, [...(map.get(key) || []), item])
return map
}, new Map())
// Create index list