Fixed default recipients behaviour when deselecting all tiers (#17133)

refs https://github.com/TryGhost/Team/issues/3349
This commit is contained in:
Jono M 2023-06-27 07:56:17 +12:00 committed by GitHub
parent d9785b7d6b
commit fdef6a30ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,8 +150,13 @@ const DefaultRecipients: React.FC = () => {
.filter(({value}) => filters.includes(value));
const setSelectedSegments = (selected: MultiValue<MultiSelectOption>) => {
const selectedGroups = selected?.map(({value}) => value).join(',');
updateSetting('editor_default_email_recipients_filter', selectedGroups);
if (selected.length) {
const selectedGroups = selected?.map(({value}) => value).join(',');
updateSetting('editor_default_email_recipients_filter', selectedGroups);
} else {
updateSetting('editor_default_email_recipients_filter', null);
setSelectedOption('none');
}
};
const values = (