From ec663eaba13294d803fdb8ddab373d7534c5a644 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 14 Nov 2024 13:50:36 +0100 Subject: [PATCH] Fix Content Warning and filter states not applying to boosted posts properly (#32887) --- app/javascript/mastodon/components/status.jsx | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/app/javascript/mastodon/components/status.jsx b/app/javascript/mastodon/components/status.jsx index 96ccf3aad4..f17f0367c1 100644 --- a/app/javascript/mastodon/components/status.jsx +++ b/app/javascript/mastodon/components/status.jsx @@ -393,20 +393,6 @@ class Status extends ImmutablePureComponent { }; let media, statusAvatar, prepend, rebloggedByText; - const matchedFilters = status.get('matched_filters'); - const expanded = (!matchedFilters || this.state.showDespiteFilter) && (!status.get('hidden') || status.get('spoiler_text').length === 0); - - if (hidden) { - return ( - -
- {status.getIn(['account', 'display_name']) || status.getIn(['account', 'username'])} - {status.get('spoiler_text').length > 0 && ({status.get('spoiler_text')})} - {expanded && {status.get('content')}} -
-
- ); - } const connectUp = previousId && previousId === status.get('in_reply_to_id'); const connectToRoot = rootId && rootId === status.get('in_reply_to_id'); @@ -446,6 +432,21 @@ class Status extends ImmutablePureComponent { ); } + const matchedFilters = status.get('matched_filters'); + const expanded = (!matchedFilters || this.state.showDespiteFilter) && (!status.get('hidden') || status.get('spoiler_text').length === 0); + + if (hidden) { + return ( + +
+ {status.getIn(['account', 'display_name']) || status.getIn(['account', 'username'])} + {status.get('spoiler_text').length > 0 && ({status.get('spoiler_text')})} + {expanded && {status.get('content')}} +
+
+ ); + } + if (pictureInPicture.get('inUse')) { media = ; } else if (status.get('media_attachments').size > 0) {