[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
This commit is contained in:
Ryan Bianchi
2024-03-30 16:03:20 -04:00
committed by GitHub
parent 38ffccb903
commit ada9e7da31
2 changed files with 11 additions and 0 deletions

View File

@@ -45,10 +45,15 @@ export function CategorySelector({
filteredGroup(categoryGroup).map(category => selectAll.push(category)),
);
if (selectedCategories === undefined) {
selectedCategories = categoryGroups.flatMap(cg => cg.categories);
}
const selectedCategoryMap = useMemo(
() => selectedCategories.map(selected => selected.id),
[selectedCategories],
);
const allCategoriesSelected = selectAll.every(category =>
selectedCategoryMap.includes(category.id),
);

View File

@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [qedi-r]
---
Fix custom report page cold-reload crash.