about summary refs log tree commit diff
path: root/src/screens/Settings/components/DeactivateAccountDialog.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-08-15 20:58:13 +0100
committerGitHub <noreply@github.com>2024-08-15 20:58:13 +0100
commitb6e515c664d51ffe357c3562fd514301805ade8c (patch)
treeac0193c172d6c7ef62ac59d411c2dfc7ae1614c3 /src/screens/Settings/components/DeactivateAccountDialog.tsx
parentf3b57dd45600c0c8197ce45a0f927b57e0799760 (diff)
downloadvoidsky-b6e515c664d51ffe357c3562fd514301805ade8c.tar.zst
Move global "Sign out" out of the current account row (#4941)
* Rename logout to logoutEveryAccount

* Add logoutCurrentAccount()

* Make all "Log out" buttons refer to current account

Each of these usages is completely contextual and refers to a specific account.

* Add Sign out of all accounts to Settings

* Move single account Sign Out below as well

* Prompt on account removal

* Add Other Accounts header to reduce ambiguity

* Spacing fix

---------

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
Diffstat (limited to 'src/screens/Settings/components/DeactivateAccountDialog.tsx')
-rw-r--r--src/screens/Settings/components/DeactivateAccountDialog.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/screens/Settings/components/DeactivateAccountDialog.tsx b/src/screens/Settings/components/DeactivateAccountDialog.tsx
index 99999d068..2be42d13e 100644
--- a/src/screens/Settings/components/DeactivateAccountDialog.tsx
+++ b/src/screens/Settings/components/DeactivateAccountDialog.tsx
@@ -35,7 +35,7 @@ function DeactivateAccountDialogInner({
   const {gtMobile} = useBreakpoints()
   const {_} = useLingui()
   const agent = useAgent()
-  const {logout} = useSessionApi()
+  const {logoutCurrentAccount} = useSessionApi()
   const [pending, setPending] = React.useState(false)
   const [error, setError] = React.useState<string | undefined>()
 
@@ -44,7 +44,7 @@ function DeactivateAccountDialogInner({
       setPending(true)
       await agent.com.atproto.server.deactivateAccount({})
       control.close(() => {
-        logout('Deactivated')
+        logoutCurrentAccount('Deactivated')
       })
     } catch (e: any) {
       switch (e.message) {
@@ -66,7 +66,7 @@ function DeactivateAccountDialogInner({
     } finally {
       setPending(false)
     }
-  }, [agent, control, logout, _, setPending])
+  }, [agent, control, logoutCurrentAccount, _, setPending])
 
   return (
     <>