Add a local setting for inline preview cards

This commit is contained in:
Thibaut Girka 2018-10-30 14:46:48 +01:00 committed by ThibG
parent bdc2338833
commit 7e18e95716
3 changed files with 10 additions and 1 deletions

View file

@ -478,7 +478,7 @@ export default class Status extends ImmutablePureComponent {
if (!status.get('sensitive') && !(status.get('spoiler_text').length > 0) && settings.getIn(['collapsed', 'backgrounds', 'preview_images'])) { if (!status.get('sensitive') && !(status.get('spoiler_text').length > 0) && settings.getIn(['collapsed', 'backgrounds', 'preview_images'])) {
background = attachments.getIn([0, 'preview_url']); background = attachments.getIn([0, 'preview_url']);
} }
} else if (status.get('card')) { } else if (status.get('card') && settings.get('inline_preview_cards')) {
media = ( media = (
<Card <Card
onOpenMedia={this.props.onOpenMedia} onOpenMedia={this.props.onOpenMedia}

View file

@ -304,6 +304,14 @@ export default class LocalSettingsPage extends React.PureComponent {
> >
<FormattedMessage id='settings.media_fullwidth' defaultMessage='Full-width media previews' /> <FormattedMessage id='settings.media_fullwidth' defaultMessage='Full-width media previews' />
</LocalSettingsPageItem> </LocalSettingsPageItem>
<LocalSettingsPageItem
settings={settings}
item={['inline_preview_cards']}
id='mastodon-settings--inline-preview-cards'
onChange={onChange}
>
<FormattedMessage id='settings.inline_preview_cards' defaultMessage='Inline preview cards for external links' />
</LocalSettingsPageItem>
</div> </div>
), ),
]; ];

View file

@ -15,6 +15,7 @@ const initialState = ImmutableMap({
always_show_spoilers_field: false, always_show_spoilers_field: false,
confirm_missing_media_description: false, confirm_missing_media_description: false,
preselect_on_reply: true, preselect_on_reply: true,
inline_preview_cards: true,
content_warnings : ImmutableMap({ content_warnings : ImmutableMap({
auto_unfold : false, auto_unfold : false,
filter : null, filter : null,