* Only send analytics events when the user is logged in * Only send analytics events when the user is logged in (web) * Add analytics identify() call
This commit is contained in:
parent
92b80ff048
commit
8e28d3c6be
6 changed files with 108 additions and 30 deletions
|
@ -8,7 +8,6 @@ import {
|
|||
View,
|
||||
} from 'react-native'
|
||||
import {observer} from 'mobx-react-lite'
|
||||
import {sha256} from 'js-sha256'
|
||||
import {useAnalytics} from 'lib/analytics'
|
||||
import {Text} from '../../util/text/Text'
|
||||
import {s, colors} from 'lib/styles'
|
||||
|
@ -22,7 +21,7 @@ import {Step3} from './Step3'
|
|||
|
||||
export const CreateAccount = observer(
|
||||
({onPressBack}: {onPressBack: () => void}) => {
|
||||
const {track, screen, identify} = useAnalytics()
|
||||
const {track, screen} = useAnalytics()
|
||||
const pal = usePalette('default')
|
||||
const store = useStores()
|
||||
const model = React.useMemo(() => new CreateAccountModel(store), [store])
|
||||
|
@ -57,14 +56,12 @@ export const CreateAccount = observer(
|
|||
} else {
|
||||
try {
|
||||
await model.submit()
|
||||
const email_hashed = sha256(model.email)
|
||||
identify(email_hashed, {email_hashed})
|
||||
track('Create Account')
|
||||
} catch {
|
||||
// dont need to handle here
|
||||
}
|
||||
}
|
||||
}, [model, identify, track])
|
||||
}, [model, track])
|
||||
|
||||
return (
|
||||
<ScrollView testID="createAccount" style={pal.view}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue