about summary refs log tree commit diff
path: root/src/lib/hooks
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2024-03-19 20:24:18 -0700
committerPaul Frazee <pfrazee@gmail.com>2024-03-19 20:24:18 -0700
commitb5bda17812a73fcbd612b54b7d73316610a68d7e (patch)
treeda211145aace25c3ff141839337e7059ceac1085 /src/lib/hooks
parent6255e33b501c1cd8d0b1e741516f4ab54a84098d (diff)
parent3d8d1dd1737c11d924bec7d51ae4deb6cb6336b0 (diff)
downloadvoidsky-b5bda17812a73fcbd612b54b7d73316610a68d7e.tar.zst
Merge branch 'main' of github.com:bluesky-social/social-app into main
Diffstat (limited to 'src/lib/hooks')
-rw-r--r--src/lib/hooks/useAccountSwitcher.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/hooks/useAccountSwitcher.ts b/src/lib/hooks/useAccountSwitcher.ts
index 74b5674d5..eb1685a0a 100644
--- a/src/lib/hooks/useAccountSwitcher.ts
+++ b/src/lib/hooks/useAccountSwitcher.ts
@@ -6,6 +6,7 @@ import {useSessionApi, SessionAccount} from '#/state/session'
 import * as Toast from '#/view/com/util/Toast'
 import {useCloseAllActiveElements} from '#/state/util'
 import {useLoggedOutViewControls} from '#/state/shell/logged-out'
+import {LogEvents} from '../statsig/statsig'
 
 export function useAccountSwitcher() {
   const {track} = useAnalytics()
@@ -14,7 +15,10 @@ export function useAccountSwitcher() {
   const {requestSwitchToAccount} = useLoggedOutViewControls()
 
   const onPressSwitchAccount = useCallback(
-    async (account: SessionAccount) => {
+    async (
+      account: SessionAccount,
+      logContext: LogEvents['account:loggedIn']['logContext'],
+    ) => {
       track('Settings:SwitchAccountButtonClicked')
 
       try {
@@ -28,7 +32,7 @@ export function useAccountSwitcher() {
             // So we change the URL ourselves. The navigator will pick it up on remount.
             history.pushState(null, '', '/')
           }
-          await selectAccount(account)
+          await selectAccount(account, logContext)
           setTimeout(() => {
             Toast.show(`Signed in as @${account.handle}`)
           }, 100)