diff --git a/src/routes/Settings/Settings.js b/src/routes/Settings/Settings.js index 6ad3ea941..807658fd2 100644 --- a/src/routes/Settings/Settings.js +++ b/src/routes/Settings/Settings.js @@ -78,10 +78,17 @@ const Settings = () => { } }); }, []); - const authenticateTraktOnClick = React.useCallback(() => { + const toggleTraktOnClick = React.useCallback(() => { if (!isTraktAuthenticated && profile.auth !== null && profile.auth.user !== null && typeof profile.auth.user._id === 'string') { window.open(`https://www.strem.io/trakt/auth/${profile.auth.user._id}`); setTraktAuthStarted(true); + } else { + core.transport.dispatch({ + action: 'Ctx', + args: { + action: 'LogoutTrakt' + } + }); } }, [isTraktAuthenticated, profile.auth]); const importFacebookOnClick = React.useCallback(() => { @@ -253,10 +260,11 @@ const Settings = () => {