diff --git a/src/plugins/consoleShortcuts/index.ts b/src/plugins/consoleShortcuts/index.ts index 0b545c0d..947251cd 100644 --- a/src/plugins/consoleShortcuts/index.ts +++ b/src/plugins/consoleShortcuts/index.ts @@ -20,6 +20,7 @@ import { Devs } from "@utils/constants"; import { getCurrentChannel, getCurrentGuild } from "@utils/discord"; import { runtimeHashMessageKey } from "@utils/intlHash"; import { SYM_LAZY_CACHED, SYM_LAZY_GET } from "@utils/lazy"; +import { ModalAPI } from "@utils/modal"; import { relaunch } from "@utils/native"; import { canonicalizeMatch, canonicalizeReplace, canonicalizeReplacement } from "@utils/patches"; import definePlugin, { PluginNative, StartAt } from "@utils/types"; @@ -144,6 +145,8 @@ function makeShortcuts() { me: { getter: () => Common.UserStore.getCurrentUser(), preload: false }, meId: { getter: () => Common.UserStore.getCurrentUser().id, preload: false }, messages: { getter: () => Common.MessageStore.getMessages(Common.SelectedChannelStore.getChannelId()), preload: false }, + openModal: { getter: () => ModalAPI.openModal }, + openModalLazy: { getter: () => ModalAPI.openModalLazy }, Stores: { getter: () => Object.fromEntries( diff --git a/src/plugins/pictureInPicture/index.tsx b/src/plugins/pictureInPicture/index.tsx index ef3d35ff..6112d9c4 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 => ( diff --git a/src/plugins/spotifyControls/PlayerComponent.tsx b/src/plugins/spotifyControls/PlayerComponent.tsx index 41e09c16..d708c279 100644 --- a/src/plugins/spotifyControls/PlayerComponent.tsx +++ b/src/plugins/spotifyControls/PlayerComponent.tsx @@ -18,6 +18,7 @@ import "./spotifyStyles.css"; +import { Settings } from "@api/Settings"; import { Flex } from "@components/Flex"; import { ImageIcon, LinkIcon, OpenExternalIcon } from "@components/Icons"; import { debounce } from "@shared/debounce"; @@ -130,7 +131,9 @@ function Controls() { > -