Improve account switcher pending state (#3827)
* Protect against races * Reduce UI jank when switching accounts * Add pending state to selected account * Disable presses while pending
This commit is contained in:
parent
8ba1b10ce0
commit
b86c3b486f
5 changed files with 105 additions and 79 deletions
|
@ -18,7 +18,7 @@ export function SwitchAccountDialog({
|
|||
}) {
|
||||
const {_} = useLingui()
|
||||
const {currentAccount} = useSession()
|
||||
const {onPressSwitchAccount, isSwitchingAccounts} = useAccountSwitcher()
|
||||
const {onPressSwitchAccount, pendingDid} = useAccountSwitcher()
|
||||
const {setShowLoggedOut} = useLoggedOutViewControls()
|
||||
|
||||
const onSelectAccount = useCallback(
|
||||
|
@ -54,7 +54,7 @@ export function SwitchAccountDialog({
|
|||
onSelectAccount={onSelectAccount}
|
||||
onSelectOther={onPressAddAccount}
|
||||
otherLabel={_(msg`Add account`)}
|
||||
isSwitchingAccounts={isSwitchingAccounts}
|
||||
pendingDid={pendingDid}
|
||||
/>
|
||||
</View>
|
||||
</Dialog.ScrollableInner>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue