Fixes issue with (#2119)
* Allow going directly to password input screen when switching accounts and password is required * Revise state handling * Handle logged out states, enable clearing requestedAccount --------- Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
parent
afca4bf701
commit
9d51886e43
4 changed files with 108 additions and 22 deletions
|
@ -11,7 +11,7 @@ export function useAccountSwitcher() {
|
|||
const {track} = useAnalytics()
|
||||
const {selectAccount, clearCurrentAccount} = useSessionApi()
|
||||
const closeAllActiveElements = useCloseAllActiveElements()
|
||||
const {setShowLoggedOut} = useLoggedOutViewControls()
|
||||
const {requestSwitchToAccount} = useLoggedOutViewControls()
|
||||
|
||||
const onPressSwitchAccount = useCallback(
|
||||
async (account: SessionAccount) => {
|
||||
|
@ -34,7 +34,7 @@ export function useAccountSwitcher() {
|
|||
}, 100)
|
||||
} else {
|
||||
closeAllActiveElements()
|
||||
setShowLoggedOut(true)
|
||||
requestSwitchToAccount({requestedAccount: account.did})
|
||||
Toast.show(
|
||||
`Please sign in as @${account.handle}`,
|
||||
'circle-exclamation',
|
||||
|
@ -50,7 +50,7 @@ export function useAccountSwitcher() {
|
|||
clearCurrentAccount,
|
||||
selectAccount,
|
||||
closeAllActiveElements,
|
||||
setShowLoggedOut,
|
||||
requestSwitchToAccount,
|
||||
],
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue