diff --git a/src/plugins/gameActivityToggle/index.tsx b/src/plugins/gameActivityToggle/index.tsx index 3024a91e1..071b4f768 100644 --- a/src/plugins/gameActivityToggle/index.tsx +++ b/src/plugins/gameActivityToggle/index.tsx @@ -86,8 +86,8 @@ function GameActivityToggleButton(props: UserAreaRenderProps) { const connectedAccounts = useStateFromStores([ConnectedAccountsStore], () => ConnectedAccountsStore.getAccounts()); const spotifyAccounts = connectedAccounts.filter(account => account.type === "spotify" && !account.revoked); - // The update is an API request which takes a bit to update the store, so we have to use our own state to reflect the change immediately - const [shareSpotifyActivity, setShareSpotifyActivity] = useState(spotifyAccounts[0]?.showActivity ?? false); + // The update is an API request which takes a bit to update the store, so keep local overrides to reflect changes immediately + const [spotifyActivityOverrides, setSpotifyActivityOverrides] = useState>({}); const buttonRef = useRef(null); @@ -103,12 +103,9 @@ function GameActivityToggleButton(props: UserAreaRenderProps) { onClick: () => ShowCurrentGame.updateSetting(old => !old) }; - // Only show switch if there's exactly one Spotify account connected. Otherwise it may lead to confusion - if (spotifyAccounts.length !== 1) + if (spotifyAccounts.length === 0) return