diff --git a/apps/admin-x-settings/src/components/settings/email/newsletters/NewsletterDetailModal.tsx b/apps/admin-x-settings/src/components/settings/email/newsletters/NewsletterDetailModal.tsx index a762d5a707..0b73777146 100644 --- a/apps/admin-x-settings/src/components/settings/email/newsletters/NewsletterDetailModal.tsx +++ b/apps/admin-x-settings/src/components/settings/email/newsletters/NewsletterDetailModal.tsx @@ -106,8 +106,15 @@ const Sidebar: React.FC<{ const {localSettings} = useSettingGroup(); const [siteTitle] = getSettingValues(localSettings, ['title']) as string[]; const handleError = useHandleError(); + const {data: {newsletters: apiNewsletters} = {}} = useBrowseNewsletters(); let newsletterAddress = renderSenderEmail(newsletter, config, defaultEmailAddress); + const [newsletters, setNewsletters] = useState(apiNewsletters || []); + const activeNewsletters = newsletters.filter(n => n.status === 'active'); + + useEffect(() => { + setNewsletters(apiNewsletters || []); + }, [apiNewsletters]); const fontOptions: SelectOption[] = [ {value: 'serif', label: 'Elegant serif', className: 'font-serif'}, @@ -252,7 +259,7 @@ const Sidebar: React.FC<{ />
- {newsletter.status === 'active' ? (!onlyOne &&
},