1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

fix bug: plans page show an error if admin dont create any plans

This commit is contained in:
Du Peng 2021-09-09 18:46:23 +02:00
parent 334d8ce055
commit c9f20ddc03

View File

@ -186,6 +186,9 @@ const PlansList: React.FC<PlansListProps> = ({ onError, onPlanSelection, onLogin
* Render the provided list of categories, with each associated plans
*/
const renderPlansByCategory = (plans: Map<number, Array<Plan>>): ReactNode => {
if (!plans) {
return null;
}
return (
<div className="list-of-categories">
{Array.from(plans).sort(compareCategories).map(([categoryId, plansByCategory]) => {