Skip to content
Snippets Groups Projects
Unverified Commit ada9e7da authored by Ryan Bianchi's avatar Ryan Bianchi Committed by GitHub
Browse files

[WIP] Fix custom reports cold-reload crash (#2528)

* when custom reports were cold-reloaded, the selections would be null crashing the page

* add release notes for PR

* fix typo in release note file name
parent 38ffccb9
No related branches found
No related tags found
No related merge requests found
...@@ -45,10 +45,15 @@ export function CategorySelector({ ...@@ -45,10 +45,15 @@ export function CategorySelector({
filteredGroup(categoryGroup).map(category => selectAll.push(category)), filteredGroup(categoryGroup).map(category => selectAll.push(category)),
); );
if (selectedCategories === undefined) {
selectedCategories = categoryGroups.flatMap(cg => cg.categories);
}
const selectedCategoryMap = useMemo( const selectedCategoryMap = useMemo(
() => selectedCategories.map(selected => selected.id), () => selectedCategories.map(selected => selected.id),
[selectedCategories], [selectedCategories],
); );
const allCategoriesSelected = selectAll.every(category => const allCategoriesSelected = selectAll.every(category =>
selectedCategoryMap.includes(category.id), selectedCategoryMap.includes(category.id),
); );
......
---
category: Bugfix
authors: [qedi-r]
---
Fix custom report page cold-reload crash.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment