mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 03:42:27 +03:00
Revert fixed publishing issue when site has no active newsletters
This commit is contained in:
parent
836b6e7be9
commit
f05ba155b8
@ -106,15 +106,8 @@ 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<Newsletter[]>(apiNewsletters || []);
|
||||
const activeNewsletters = newsletters.filter(n => n.status === 'active');
|
||||
|
||||
useEffect(() => {
|
||||
setNewsletters(apiNewsletters || []);
|
||||
}, [apiNewsletters]);
|
||||
|
||||
const fontOptions: SelectOption[] = [
|
||||
{value: 'serif', label: 'Elegant serif', className: 'font-serif'},
|
||||
@ -259,7 +252,7 @@ const Sidebar: React.FC<{
|
||||
/>
|
||||
</Form>
|
||||
<div className='mb-5 mt-10'>
|
||||
{newsletter.status === 'active' ? (!onlyOne && <Button color='red' disabled={activeNewsletters.length === 1} label='Archive newsletter' link onClick={confirmStatusChange}/>) : <Button color='green' label='Reactivate newsletter' link onClick={confirmStatusChange} />}
|
||||
{newsletter.status === 'active' ? (!onlyOne && <Button color='red' label='Archive newsletter' link onClick={confirmStatusChange} />) : <Button color='green' label='Reactivate newsletter' link onClick={confirmStatusChange} />}
|
||||
</div>
|
||||
</>
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user