diff options
author | Ansh <anshnanda10@gmail.com> | 2023-12-07 16:53:50 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-07 16:53:50 -0800 |
commit | 9d51886e438b1676706009d91bdcf20e8df5dd58 (patch) | |
tree | 97abc18e7ddf3c288c355ba81988c959df86908e /src/lib/hooks/useAccountSwitcher.ts | |
parent | afca4bf70160b6b15e3fe55e2cf8ba326a30597c (diff) | |
download | voidsky-9d51886e438b1676706009d91bdcf20e8df5dd58.tar.zst |
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>
Diffstat (limited to 'src/lib/hooks/useAccountSwitcher.ts')
-rw-r--r-- | src/lib/hooks/useAccountSwitcher.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/hooks/useAccountSwitcher.ts b/src/lib/hooks/useAccountSwitcher.ts index 2f2c110d9..74b5674d5 100644 --- a/src/lib/hooks/useAccountSwitcher.ts +++ b/src/lib/hooks/useAccountSwitcher.ts @@ -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, ], ) |