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>
This commit is contained in:
parent
f3b57dd456
commit
b6e515c664
11 changed files with 247 additions and 77 deletions
|
@ -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 (
|
||||
<>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue