Allow disabling feed injection

ads-account
Alex Gleason 2022-11-27 21:05:39 -06:00
rodzic 3a489f98d2
commit 84edb651ad
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
3 zmienionych plików z 17 dodań i 1 usunięć

Wyświetl plik

@ -189,7 +189,9 @@ const StatusList: React.FC<IStatusList> = ({
if (statusId === null) {
acc.push(renderLoadGap(index));
} else if (statusId.startsWith('末suggestions-')) {
acc.push(renderFeedSuggestions());
if (soapboxConfig.feedInjection) {
acc.push(renderFeedSuggestions());
}
} else if (statusId.startsWith('末pending-')) {
acc.push(renderPendingStatus(statusId));
} else {

Wyświetl plik

@ -52,6 +52,8 @@ const messages = defineMessages({
singleUserModeHint: { id: 'soapbox_config.single_user_mode_hint', defaultMessage: 'Front page will redirect to a given user profile.' },
singleUserModeProfileLabel: { id: 'soapbox_config.single_user_mode_profile_label', defaultMessage: 'Main user handle' },
singleUserModeProfileHint: { id: 'soapbox_config.single_user_mode_profile_hint', defaultMessage: '@handle' },
feedInjectionLabel: { id: 'soapbox_config.feed_injection_label', defaultMessage: 'Feed injection' },
feedInjectionHint: { id: 'soapbox_config.feed_injection_hint', defaultMessage: 'Inject the feed with additional content, such as suggested profiles.' },
});
type ValueGetter<T = Element> = (e: React.ChangeEvent<T>) => any;
@ -261,6 +263,16 @@ const SoapboxConfig: React.FC = () => {
/>
</ListItem>
<ListItem
label={intl.formatMessage(messages.feedInjectionLabel)}
hint={intl.formatMessage(messages.feedInjectionHint)}
>
<Toggle
checked={soapbox.feedInjection === true}
onChange={handleChange(['feedInjection'], (e) => e.target.checked)}
/>
</ListItem>
<ListItem label={intl.formatMessage(messages.displayCtaLabel)}>
<Toggle
checked={soapbox.displayCta === true}

Wyświetl plik

@ -112,6 +112,8 @@ export const SoapboxConfigRecord = ImmutableRecord({
linkFooterMessage: '',
links: ImmutableMap<string, string>(),
displayCta: true,
/** Whether to inject suggested profiles into the Home feed. */
feedInjection: true,
}, 'SoapboxConfig');
type SoapboxConfigMap = ImmutableMap<string, any>;