Don't clear toasts when changing users (#3843)

* Move ThemeProvider to the top

* Move RootSiblingParent above the remounted part

* Move ToastContainer outside the remounted part

* Remove setTimeout around toasts

* Consistently handle dropped session
This commit is contained in:
dan 2024-05-03 16:36:58 +01:00 committed by GitHub
parent aeed4786db
commit 85b34418ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 64 additions and 62 deletions

View file

@ -41,9 +41,7 @@ export function useAccountSwitcher() {
}
await initSession(account)
logEvent('account:loggedIn', {logContext, withPassword: false})
setTimeout(() => {
Toast.show(_(msg`Signed in as @${account.handle}`))
}, 100)
Toast.show(_(msg`Signed in as @${account.handle}`))
} else {
requestSwitchToAccount({requestedAccount: account.did})
Toast.show(
@ -56,9 +54,6 @@ export function useAccountSwitcher() {
message: e.message,
})
clearCurrentAccount() // back user out to login
setTimeout(() => {
Toast.show(_(msg`Sorry! We need you to enter your password.`))
}, 100)
} finally {
setPendingDid(null)
}