Allow disabling feed injection
This commit is contained in:
parent
3a489f98d2
commit
84edb651ad
3 changed files with 17 additions and 1 deletions
|
@ -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 {
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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>;
|
||||
|
|
Loading…
Reference in a new issue