|
|
|
@ -18,6 +18,7 @@
|
|
|
|
|
|
|
|
|
|
import { Settings } from "@api/Settings";
|
|
|
|
|
import { disableStyle, enableStyle } from "@api/Styles";
|
|
|
|
|
import ErrorBoundary from "@components/ErrorBoundary";
|
|
|
|
|
import { Devs } from "@utils/constants";
|
|
|
|
|
import definePlugin, { OptionType } from "@utils/types";
|
|
|
|
|
|
|
|
|
@ -49,10 +50,10 @@ export default definePlugin({
|
|
|
|
|
{
|
|
|
|
|
find: "showTaglessAccountPanel:",
|
|
|
|
|
replacement: {
|
|
|
|
|
// return React.createElement(AccountPanel, { ..., showTaglessAccountPanel: blah })
|
|
|
|
|
match: /return ?(.{0,30}\(.{1,3},\{[^}]+?,showTaglessAccountPanel:.+?\}\))/,
|
|
|
|
|
// return [Player, Panel]
|
|
|
|
|
replace: "return [$self.renderPlayer(),$1]"
|
|
|
|
|
// react.jsx)(AccountPanel, { ..., showTaglessAccountPanel: blah })
|
|
|
|
|
match: /(?<=\i\.jsxs?\)\()(\i),{(?=[^}]*?showTaglessAccountPanel:)/,
|
|
|
|
|
// react.jsx(WrapperComponent, { VencordOriginal: AccountPanel, ...
|
|
|
|
|
replace: "$self.PanelWrapper,{VencordOriginal:$1,"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -78,6 +79,25 @@ export default definePlugin({
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
start: () => toggleHoverControls(Settings.plugins.SpotifyControls.hoverControls),
|
|
|
|
|
renderPlayer: () => <Player />
|
|
|
|
|
|
|
|
|
|
PanelWrapper({ VencordOriginal, ...props }) {
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<ErrorBoundary
|
|
|
|
|
fallback={() => (
|
|
|
|
|
<div className="vc-spotify-fallback">
|
|
|
|
|
<p>Failed to render Spotify Modal :(</p>
|
|
|
|
|
<p >Check the console for errors</p>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<Player />
|
|
|
|
|
</ErrorBoundary>
|
|
|
|
|
|
|
|
|
|
<VencordOriginal {...props} />
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|