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 (