From f41a74ea171fe9c2363f8adb84479318edf23a00 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 5 Aug 2026 10:20:35 -0400 Subject: [PATCH] YTDescription: Fix Patch --- src/plugins/fixYoutubeEmbeds.desktop/index.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/plugins/fixYoutubeEmbeds.desktop/index.tsx b/src/plugins/fixYoutubeEmbeds.desktop/index.tsx index d76bd666e..49aa97e1c 100644 --- a/src/plugins/fixYoutubeEmbeds.desktop/index.tsx +++ b/src/plugins/fixYoutubeEmbeds.desktop/index.tsx @@ -32,21 +32,18 @@ export default definePlugin({ settings, patches: [ { - find: "#{intl::SUPPRESS_ALL_EMBEDS}", + find: "this.renderContentPlaceholder({", predicate: () => settings.store.youtubeDescription, replacement: { - match: /case (\i\.\i\.VIDEO):(case \i\.\i\.\i:)*break;default:(\i)=(?:(this\.renderDescription)\(\))\}/, - replace: "$2 break; case $1: $3 = $self.ToggleableDescriptionWrapper({ embed: this.props.embed, original: $4.bind(this) }); break; default: $3 = $4() }" + match: /(\i)=(\i\.\i\.has\((\i)\.type\))\?null:(?:(this\.renderDescription)\(\))/, + replace: '$1=$3.type==="video"?$self.ToggleableDescriptionWrapper({embed:this.props.embed,original:$4.bind(this)}):($2?null:$4())' } } ], ToggleableDescription: ErrorBoundary.wrap(({ embed, original }: ToggleableDescriptionProps) => { const [isOpen, setOpen] = useState(false); - - if (!embed.rawDescription) - return null; - if (embed.rawDescription.length <= 20) - return original(); + if (!embed.rawDescription) return null; + if (embed.rawDescription.length <= 20) return original(); return (