From 0a55c3bdf815b86d984db28b9896b5bcc28ca976 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 29 Dec 2022 09:07:12 +0100 Subject: [PATCH] feat(Settings): implement trakt logout --- src/routes/Settings/Settings.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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 = () => {
Trakt Scrobbling
-