diff --git a/src/routes/Settings/General/General.tsx b/src/routes/Settings/General/General.tsx index 62bcdf783..a5b8409e1 100644 --- a/src/routes/Settings/General/General.tsx +++ b/src/routes/Settings/General/General.tsx @@ -62,18 +62,21 @@ const General = forwardRef(({ profile }: Props, ref) => { } }, [isTraktAuthenticated, profile.auth]); - const onToggleDiscord = useCallback(() => { - core.transport.dispatch({ - action: 'Ctx', - args: { - action: 'UpdateSettings', + const discordToggle = useMemo(() => ({ + checked: profile.settings.discordRpcEnabled === true, + onClick: () => { + core.transport.dispatch({ + action: 'Ctx', args: { - ...profile.settings, - discordRpcEnabled: !profile.settings.discordRpcEnabled + action: 'UpdateSettings', + args: { + ...profile.settings, + discordRpcEnabled: !profile.settings.discordRpcEnabled + } } - } - }); - }, [profile.settings]); + }); + } + }), [profile.settings]); useEffect(() => { if (dataExport.exportUrl) { @@ -150,11 +153,10 @@ const General = forwardRef(({ profile }: Props, ref) => { { discord.available && - }