Prevent closing modal when templates are still loading

[MAILPOET-6049]
This commit is contained in:
Rostislav Wolny
2024-05-03 14:54:04 +02:00
committed by Aschepikov
parent 960884a484
commit a1bd40f6ef

View File

@ -30,6 +30,7 @@ export function SelectTemplateModal({ onSelectCallback }) {
const blankTemplate = templates.find( const blankTemplate = templates.find(
(template) => template.slug === BLANK_TEMPLATE, (template) => template.slug === BLANK_TEMPLATE,
); );
if (!blankTemplate) return; // Prevent close if blank template is still not loaded
handleTemplateSelection(blankTemplate); handleTemplateSelection(blankTemplate);
}; };