[Statsig] Track login/logout (#3286)
* [Statsig] Track login/logout * Fix missing attribution
This commit is contained in:
parent
2e2fae378a
commit
3d8d1dd173
10 changed files with 98 additions and 48 deletions
|
@ -16,6 +16,7 @@ import {useSession, useSessionApi, SessionAccount} from '#/state/session'
|
|||
import {useProfileQuery} from '#/state/queries/profile'
|
||||
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
import {logEvent} from '#/lib/statsig/statsig'
|
||||
|
||||
function AccountItem({
|
||||
account,
|
||||
|
@ -102,6 +103,10 @@ export const ChooseAccountForm = ({
|
|||
Toast.show(_(msg`Already signed in as @${account.handle}`))
|
||||
} else {
|
||||
await initSession(account)
|
||||
logEvent('account:loggedIn', {
|
||||
logContext: 'ChooseAccountForm',
|
||||
withPassword: false,
|
||||
})
|
||||
track('Sign In', {resumedSession: true})
|
||||
setTimeout(() => {
|
||||
Toast.show(_(msg`Signed in as @${account.handle}`))
|
||||
|
|
|
@ -98,11 +98,14 @@ export const LoginForm = ({
|
|||
}
|
||||
|
||||
// TODO remove double login
|
||||
await login({
|
||||
service: serviceUrl,
|
||||
identifier: fullIdent,
|
||||
password,
|
||||
})
|
||||
await login(
|
||||
{
|
||||
service: serviceUrl,
|
||||
identifier: fullIdent,
|
||||
password,
|
||||
},
|
||||
'LoginForm',
|
||||
)
|
||||
} catch (e: any) {
|
||||
const errMsg = e.toString()
|
||||
setIsProcessing(false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue