Improve account switching on mobile (#2135)

* Improve account switching on mobile

* Clarify comment
zio/stable
Eric Bailey 2023-12-07 15:44:59 -06:00 committed by GitHub
parent 174a1622c9
commit b7a5294123
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -23,8 +23,16 @@ export function useAccountSwitcher() {
try {
if (account.accessJwt) {
closeAllActiveElements()
navigation.navigate(isWeb ? 'Home' : 'HomeTab')
await selectAccount(account)
/*
* Mobile resets to Home on its own, so no need to handle mobile
* specifically.
*/
if (isWeb) {
navigation.navigate('Home')
}
setTimeout(() => {
Toast.show(`Signed in as @${account.handle}`)
}, 100)