Remove status background feature (#2640)

This commit is contained in:
Claire
2024-12-10 08:55:08 +01:00
committed by GitHub
parent ec9f360217
commit 28751ff042
5 changed files with 1 additions and 65 deletions

View File

@@ -544,7 +544,6 @@ class Status extends ImmutablePureComponent {
...other
} = this.props;
const { isCollapsed } = this.state;
let background = null;
let attachments = null;
// Depending on user settings, some media are considered as parts of the
@@ -622,21 +621,10 @@ class Status extends ImmutablePureComponent {
);
}
// If user backgrounds for collapsed statuses are enabled, then we
// initialize our background accordingly. This will only be rendered if
// the status is collapsed.
if (settings.getIn(['collapsed', 'backgrounds', 'user_backgrounds'])) {
background = status.getIn(['account', 'header']);
}
// This handles our media attachments.
// If a media file is of unknwon type or if the status is muted
// (notification), we show a list of links instead of embedded media.
// After we have generated our appropriate media element and stored it in
// `media`, we snatch the thumbnail to use as our `background` if media
// backgrounds for collapsed statuses are enabled.
attachments = status.get('media_attachments');
if (pictureInPicture.get('inUse')) {
@@ -729,10 +717,6 @@ class Status extends ImmutablePureComponent {
);
mediaIcons.push('video-camera');
}
if (!status.get('sensitive') && !(status.get('spoiler_text').length > 0) && settings.getIn(['collapsed', 'backgrounds', 'preview_images'])) {
background = attachments.getIn([0, 'preview_url']);
}
} else if (status.get('card') && settings.get('inline_preview_cards') && !this.props.muted) {
media.push(
<Card
@@ -803,9 +787,8 @@ class Status extends ImmutablePureComponent {
{!skipPrepend && prepend}
<div
className={classNames('status', `status-${status.get('visibility')}`, { 'status-reply': !!status.get('in_reply_to_id'), 'status--in-thread': !!rootId, 'status--first-in-thread': previousId && (!connectUp || connectToRoot), muted: this.props.muted, 'has-background': isCollapsed && background })}
className={classNames('status', `status-${status.get('visibility')}`, { 'status-reply': !!status.get('in_reply_to_id'), 'status--in-thread': !!rootId, 'status--first-in-thread': previousId && (!connectUp || connectToRoot), muted: this.props.muted })}
data-id={status.get('id')}
style={isCollapsed && background ? { backgroundImage: `url(${background})` } : null}
>
{(connectReply || connectUp || connectToRoot) && <div className={classNames('status__line', { 'status__line--full': connectReply, 'status__line--first': !status.get('in_reply_to_id') && !connectToRoot })} />}