From 9b716706ffe647036f844c826e6af2401db7d1be Mon Sep 17 00:00:00 2001
From: thororen1234 <78185467+thororen1234@users.noreply.github.com>
Date: Sun, 7 Dec 2025 13:45:17 -0500
Subject: [PATCH] SpotifyActivityToggle: toolbox option
---
.../index.tsx | 15 ++-
.../spotifyActivityToggle/index.tsx | 100 +++++++++++++-----
2 files changed, 78 insertions(+), 37 deletions(-)
diff --git a/src/equicordplugins/clipsEnhancements.discordDesktop/index.tsx b/src/equicordplugins/clipsEnhancements.discordDesktop/index.tsx
index bb8ddabc7..cd144a4c1 100644
--- a/src/equicordplugins/clipsEnhancements.discordDesktop/index.tsx
+++ b/src/equicordplugins/clipsEnhancements.discordDesktop/index.tsx
@@ -5,13 +5,11 @@
*/
import { definePluginSettings } from "@api/Settings";
-import { Link } from "@components/Link";
+import { Button } from "@components/Button";
import { Devs } from "@utils/constants";
-import { ModalAPI } from "@utils/modal";
import definePlugin, { OptionType } from "@utils/types";
import { Activity, SelectOption } from "@vencord/discord-types";
-import { findStoreLazy } from "@webpack";
-import { PresenceStore, UserStore } from "@webpack/common";
+import { openUserSettingsPanel, PresenceStore, UserStore } from "@webpack/common";
const settings = definePluginSettings({
richPresenceTagging: {
@@ -29,14 +27,13 @@ const settings = definePluginSettings({
component: () => {
return (
<>
- {
- ModalAPI.closeAllModals();
+ openUserSettingsPanel("clips");
}}
>
Change FPS and duration options in Clips settings!
-
+
>
);
}
@@ -73,7 +70,7 @@ export default definePlugin({
patchTimeslots(timeslots: SelectOption[]) {
const newTimeslots = [...timeslots];
- const extraTimeslots = [3, 5, 7, 10];
+ const extraTimeslots = [3, 5, 7, 10, 15, 20, 25, 30];
extraTimeslots.forEach(timeslot => newTimeslots.push({ value: timeslot * 60000, label: `${timeslot} Minutes` }));
diff --git a/src/equicordplugins/spotifyActivityToggle/index.tsx b/src/equicordplugins/spotifyActivityToggle/index.tsx
index ab59fd249..1e74cf634 100644
--- a/src/equicordplugins/spotifyActivityToggle/index.tsx
+++ b/src/equicordplugins/spotifyActivityToggle/index.tsx
@@ -4,11 +4,17 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
+import { isPluginEnabled } from "@api/PluginManager";
+import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
+import equicordToolbox from "@equicordplugins/equicordToolbox";
import { Devs } from "@utils/constants";
-import definePlugin from "@utils/types";
+import definePlugin, { OptionType } from "@utils/types";
import { findComponentByCodeLazy } from "@webpack";
-import { Constants, React, RestAPI, useEffect, useState } from "@webpack/common";
+import { Constants, Menu, React, RestAPI, useEffect, useState } from "@webpack/common";
+
+let spotifyId: string | null = null;
+let showActivity: boolean = false;
const Button = findComponentByCodeLazy(".NONE,disabled:", ".PANEL_BUTTON");
@@ -34,41 +40,31 @@ function makeSpotifyIcon(enabled: boolean) {
);
}
-function SpotifyActivityToggleButton() {
- const [loading, setLoading] = useState(true);
- const [id, setId] = useState(null);
- const [showActivity, setShowActivity] = useState(null);
+function SpotifyActivityToggleButton(props: { nameplate?: any; }) {
+ const { location } = settings.use(["location"]);
+ const [showActivityState, setShowActivityState] = useState(showActivity);
useEffect(() => {
- (async () => {
- const { body } = await RestAPI.get({
- url: Constants.Endpoints.CONNECTIONS,
- });
- if (!body) return;
-
- const spotifyConn = body.find(c => c.type === "spotify");
- if (spotifyConn) {
- setId(spotifyConn.id);
- setShowActivity(spotifyConn.show_activity);
- }
- setLoading(false);
- })();
+ setShowActivityState(showActivity);
}, []);
- if (loading || !id || showActivity === null) return null;
+ if (showActivity === null) return null;
+ if (!spotifyId || location !== "PANEL" && isPluginEnabled(equicordToolbox.name)) return null;
return (