1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-08 08:56:22 +00:00

PictureInPicture: Fix picture in picture button (#3120)

This commit is contained in:
sadan4 2025-01-04 00:08:17 -05:00 committed by Nuckyz
parent 3af06edb95
commit 16a1c44947
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -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 (
<Tooltip text="Toggle Picture in Picture">
{tooltipProps => (