From c989a9c7bd5bd7d63540eafc76a7066d27c53698 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sun, 4 May 2025 23:47:57 -0400 Subject: [PATCH] SpotifyActivityToggle: Unhide Setting --- .../spotifyActivityToggle/index.tsx | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/equicordplugins/spotifyActivityToggle/index.tsx b/src/equicordplugins/spotifyActivityToggle/index.tsx index f20ac4dc..a9f3b283 100644 --- a/src/equicordplugins/spotifyActivityToggle/index.tsx +++ b/src/equicordplugins/spotifyActivityToggle/index.tsx @@ -35,9 +35,24 @@ function makeSpotifyIcon(enabled: boolean) { ); } +async function setSpotifyActivity(value: boolean) { + const { body } = await RestAPI.get({ + url: Constants.Endpoints.CONNECTIONS + }); + + if (!body) return; + const spotifyId = body.find(conn => conn.type === "spotify")?.id; + + await RestAPI.patch({ + url: Constants.Endpoints.CONNECTION("spotify", spotifyId), + body: { + show_activity: value, + }, + }); +} + function SpotifyActivityToggleButton() { const { spotifyConnection } = settings.store; - const setSpotifyConnection = value => settings.store.spotifyConnection = value; return (