From d60a8efcbff5f6eebdc29c6ed73e6012f6b9f064 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..6112d9c4f 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: (m, showDownload, isVisualMediaType) => `${m}.unshift(${showDownload}&&${isVisualMediaType}&&$self.PictureInPictureButton())` } } ], - renderPiPButton: ErrorBoundary.wrap(() => { + PictureInPictureButton: ErrorBoundary.wrap(() => { return ( {tooltipProps => (