From 16a1c44947c19596646c26e24548afd7b70171f1 Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Sat, 4 Jan 2025 00:08:17 -0500 Subject: [PATCH] PictureInPicture: Fix picture in picture button (#3120) --- src/plugins/pictureInPicture/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/pictureInPicture/index.tsx b/src/plugins/pictureInPicture/index.tsx index ef3d35ff1..1d75319a8 100644 --- a/src/plugins/pictureInPicture/index.tsx +++ b/src/plugins/pictureInPicture/index.tsx @@ -30,13 +30,13 @@ export default definePlugin({ { find: ".removeMosaicItemHoverButton),", replacement: { - match: /\.nonMediaMosaicItem\]:.{0,40}children:\[(?<=showDownload:(\i).+?isVisualMediaType:(\i).+?)/, - replace: "$&$1&&$2&&$self.renderPiPButton()," + match: /(\.nonMediaMosaicItem\]:.{0,40}children:)(\i.slice\(\i\))(?<=showDownload:(\i).+?isVisualMediaType:(\i).+?)/, + replace: (_, rest, origChildren, showDownload, isVisualMediaType) => `${rest}[${showDownload}&&${isVisualMediaType}&&$self.PictureInPictureButton(),...${origChildren}]` } } ], - renderPiPButton: ErrorBoundary.wrap(() => { + PictureInPictureButton: ErrorBoundary.wrap(() => { return ( {tooltipProps => (