about summary refs log tree commit diff
path: root/src/lib/hooks
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-05-03 16:36:58 +0100
committerGitHub <noreply@github.com>2024-05-03 16:36:58 +0100
commit85b34418ef31247f8d88bdb08248a149192c5b46 (patch)
treea4fbf0346f2609c90153a57be87f16a76f47c1d1 /src/lib/hooks
parentaeed4786db28e9efcf41ed81ab06c108fa8e3fc0 (diff)
downloadvoidsky-85b34418ef31247f8d88bdb08248a149192c5b46.tar.zst
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
Diffstat (limited to 'src/lib/hooks')
-rw-r--r--src/lib/hooks/useAccountSwitcher.ts7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/lib/hooks/useAccountSwitcher.ts b/src/lib/hooks/useAccountSwitcher.ts
index de50e5336..558fcf74b 100644
--- a/src/lib/hooks/useAccountSwitcher.ts
+++ b/src/lib/hooks/useAccountSwitcher.ts
@@ -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)
       }