aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/spotifyControls
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/spotifyControls')
-rw-r--r--src/plugins/spotifyControls/PlayerComponent.tsx17
-rw-r--r--src/plugins/spotifyControls/SpotifyStore.ts15
-rw-r--r--src/plugins/spotifyControls/index.tsx5
3 files changed, 19 insertions, 18 deletions
diff --git a/src/plugins/spotifyControls/PlayerComponent.tsx b/src/plugins/spotifyControls/PlayerComponent.tsx
index 6396e02..24394c6 100644
--- a/src/plugins/spotifyControls/PlayerComponent.tsx
+++ b/src/plugins/spotifyControls/PlayerComponent.tsx
@@ -16,13 +16,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import ErrorBoundary from "../../components/ErrorBoundary";
-import { Flex } from "../../components/Flex";
-import { Link } from "../../components/Link";
-import { debounce } from "../../utils/debounce";
-import { classes, LazyComponent, lazyWebpack } from "../../utils/misc";
-import { ContextMenu, FluxDispatcher, Forms, Menu, React } from "../../webpack/common";
-import { filters, find } from "../../webpack/webpack";
+import ErrorBoundary from "@components/ErrorBoundary";
+import { Flex } from "@components/Flex";
+import { Link } from "@components/Link";
+import { debounce } from "@utils/debounce";
+import { classes, LazyComponent } from "@utils/misc";
+import { filters, find, findByCodeLazy } from "@webpack";
+import { ContextMenu, FluxDispatcher, Forms, Menu, React } from "@webpack/common";
+
import { SpotifyStore, Track } from "./SpotifyStore";
const cl = (className: string) => `vc-spotify-${className}`;
@@ -40,7 +41,7 @@ const useStateFromStores: <T>(
idk?: null,
compare?: (old: T, newer: T) => boolean
) => T
- = lazyWebpack(filters.byCode("useStateFromStores"));
+ = findByCodeLazy("useStateFromStores");
function Svg(path: string, label: string) {
return () => (
diff --git a/src/plugins/spotifyControls/SpotifyStore.ts b/src/plugins/spotifyControls/SpotifyStore.ts
index 14f2331..75448dc 100644
--- a/src/plugins/spotifyControls/SpotifyStore.ts
+++ b/src/plugins/spotifyControls/SpotifyStore.ts
@@ -16,13 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import cssText from "~fileContent/spotifyStyles.css";
+import IpcEvents from "@utils/IpcEvents";
+import { proxyLazy } from "@utils/proxyLazy";
+import { findByPropsLazy } from "@webpack";
+import { Flux, FluxDispatcher } from "@webpack/common";
-import IpcEvents from "../../utils/IpcEvents";
-import { lazyWebpack } from "../../utils/misc";
-import { proxyLazy } from "../../utils/proxyLazy";
-import { filters } from "../../webpack";
-import { Flux, FluxDispatcher } from "../../webpack/common";
+import cssText from "~fileContent/spotifyStyles.css";
export interface Track {
id: string;
@@ -78,8 +77,8 @@ export const SpotifyStore = proxyLazy(() => {
// For some reason ts hates extends Flux.Store
const { Store } = Flux;
- const SpotifySocket = lazyWebpack(filters.byProps("getActiveSocketAndDevice"));
- const SpotifyAPI = lazyWebpack(filters.byProps("SpotifyAPIMarker"));
+ const SpotifySocket = findByPropsLazy("getActiveSocketAndDevice");
+ const SpotifyAPI = findByPropsLazy("SpotifyAPIMarker");
const API_BASE = "https://api.spotify.com/v1/me/player";
diff --git a/src/plugins/spotifyControls/index.tsx b/src/plugins/spotifyControls/index.tsx
index 14c7a93..7ab1e37 100644
--- a/src/plugins/spotifyControls/index.tsx
+++ b/src/plugins/spotifyControls/index.tsx
@@ -16,8 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import { Devs } from "../../utils/constants";
-import definePlugin from "../../utils/types";
+import { Devs } from "@utils/constants";
+import definePlugin from "@utils/types";
+
import { Player } from "./PlayerComponent";
export default definePlugin({