From ba884ce6594e1ff15e1dffaf83dbb023a0c2fde8 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 15 Aug 2024 01:42:10 +0100 Subject: [PATCH] Add Sign out of all accounts to Settings --- src/view/screens/Settings/index.tsx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/view/screens/Settings/index.tsx b/src/view/screens/Settings/index.tsx index 01ccc29f34..3b17997bcb 100644 --- a/src/view/screens/Settings/index.tsx +++ b/src/view/screens/Settings/index.tsx @@ -173,6 +173,7 @@ export function SettingsScreen({}: Props) { const {accounts, currentAccount} = useSession() const {mutate: clearPreferences} = useClearPreferencesMutation() const {setShowLoggedOut} = useLoggedOutViewControls() + const {logoutEveryAccount} = useSessionApi() const closeAllActiveElements = useCloseAllActiveElements() const exportCarControl = useDialogControl() const birthdayControl = useDialogControl() @@ -237,6 +238,10 @@ export function SettingsScreen({}: Props) { openModal({name: 'delete-account'}) }, [openModal]) + const onPressLogoutEveryAccount = React.useCallback(() => { + logoutEveryAccount('Settings') + }, [logoutEveryAccount]) + const onPressResetPreferences = React.useCallback(async () => { clearPreferences() }, [clearPreferences]) @@ -422,6 +427,27 @@ export function SettingsScreen({}: Props) { Add account + + {accounts.length > 1 && ( + + + + + + Sign out of all accounts + + + )}