1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

(bug) broken display after a plan category was deleted

This commit is contained in:
Sylvain 2023-03-22 11:03:20 +01:00
parent 01df96dc20
commit f6a9a43767
2 changed files with 3 additions and 2 deletions

View File

@ -6,6 +6,7 @@
- Updated responders to 3.0
- Updated devise to 4.9
- Updated sassc to 2.3
- Fix a bug: broken display after a plan category was deleted
## v5.9.1 2023 March 22

View File

@ -196,9 +196,9 @@ export const PlansList: React.FC<PlansListProps> = ({ onError, onPlanSelection,
{Array.from(plans).sort(compareCategories).map(([categoryId, plansByCategory]) => {
const category = findCategory(categoryId);
const categoryPlans = plansByCategory.filter(filterPlan);
const isShown = !!categoryId && categoryPlans.length > 0;
const isShown = !!category && categoryPlans.length > 0;
return (
<div key={categoryId} className={`plans-per-category ${categoryId ? 'with-category' : 'no-category'}`}>
<div key={categoryId} className={`plans-per-category ${category ? 'with-category' : 'no-category'}`}>
{isShown && <h3 className="category-title">{ category.name }</h3>}
{isShown && <p className="category-description" dangerouslySetInnerHTML={{ __html: category.description }} />}
{renderPlans(categoryPlans)}