diff options
Diffstat (limited to 'src/screens')
-rw-r--r-- | src/screens/Login/ChooseAccountForm.tsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/screens/Login/ChooseAccountForm.tsx b/src/screens/Login/ChooseAccountForm.tsx index d36d10977..8a58ac03d 100644 --- a/src/screens/Login/ChooseAccountForm.tsx +++ b/src/screens/Login/ChooseAccountForm.tsx @@ -22,6 +22,7 @@ export const ChooseAccountForm = ({ onSelectAccount: (account?: SessionAccount) => void onPressBack: () => void }) => { + const [isSwitchingAccounts, setIsSwitchingAccounts] = React.useState(false) const {track, screen} = useAnalytics() const {_} = useLingui() const {currentAccount} = useSession() @@ -40,6 +41,7 @@ export const ChooseAccountForm = ({ Toast.show(_(msg`Already signed in as @${account.handle}`)) } else { try { + setIsSwitchingAccounts(true) await initSession(account) logEvent('account:loggedIn', { logContext: 'ChooseAccountForm', @@ -54,6 +56,8 @@ export const ChooseAccountForm = ({ message: e.message, }) onSelectAccount(account) + } finally { + setIsSwitchingAccounts(false) } } } else { @@ -74,6 +78,7 @@ export const ChooseAccountForm = ({ <AccountList onSelectAccount={onSelect} onSelectOther={() => onSelectAccount()} + isSwitchingAccounts={isSwitchingAccounts} /> </View> <View style={[a.flex_row]}> |