Skip to content

Commit c64a609

Browse files
authored
Remove setUserId as email & stop calling identify on handle page (#11960)
1 parent 2b59cf1 commit c64a609

File tree

4 files changed

+1
-13
lines changed

4 files changed

+1
-13
lines changed

packages/mobile/src/screens/sign-on-screen/screens/PickHandleScreen.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
} from '@audius/harmony-native'
2424
import { ScrollView } from 'app/components/core'
2525
import { useNavigation } from 'app/hooks/useNavigation'
26-
import { identify } from 'app/services/analytics'
2726

2827
import { HandleField } from '../components/HandleField'
2928
import { SocialMediaLoading } from '../components/SocialMediaLoading'
@@ -121,7 +120,6 @@ export const PickHandleScreen = () => {
121120
(values: PickHandleValues) => {
122121
const { handle } = values
123122
dispatch(setValueField('handle', handle))
124-
identify({ handle })
125123
navigation.navigate('FinishProfile')
126124
},
127125
[dispatch, navigation]

packages/mobile/src/services/analytics.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ export const identify = async (traits: IdentifyTraits) => {
8484

8585
if (traits.handle) {
8686
setUserId(traits.handle)
87-
} else if (traits.email) {
88-
// Use email as our user identifier before we have handle (works better for partial accounts in the signup flow)
89-
setUserId(traits.email)
9087
}
9188
const identifyObj = new Identify()
9289
Object.entries(traits).forEach(([key, value]) => {

packages/web/src/pages/sign-up-page/pages/PickHandlePage.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
import { ToastContext } from 'components/toast/ToastContext'
2626
import { useMedia } from 'hooks/useMedia'
2727
import { useNavigateToPage } from 'hooks/useNavigateToPage'
28-
import { identify } from 'services/analytics'
2928
import { restrictedHandles } from 'utils/restrictedHandles'
3029

3130
import { HandleField } from '../components/HandleField'
@@ -124,7 +123,6 @@ export const PickHandlePage = () => {
124123
const handleSubmit = useCallback(
125124
(values: PickHandleValues) => {
126125
const { handle } = values
127-
identify({ handle })
128126
dispatch(setValueField('handle', handle))
129127
if (isFastReferral) {
130128
dispatch(setValueField('name', handle))

packages/web/src/services/analytics/amplitude.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,10 @@ export const identify = (traits?: IdentifyTraits, callback?: () => void) => {
4646

4747
if (traits?.handle) {
4848
amplitude.setUserId(traits.handle)
49-
} else if (traits?.email) {
50-
// Use email as our user identifier before we have handle (works better for partial accounts in the signup flow)
51-
amplitude.setUserId(traits.email)
5249
}
53-
5450
if (traits && Object.keys(traits).length > 0) {
5551
const identifyObj = new amplitude.Identify()
56-
// @ts-ignore - for some reason it doesn't want you to pass strings, but it works fine
57-
Object.entries(traits).map(([k, v]) => identifyObj.add(k, v))
52+
Object.entries(traits).map(([k, v]) => identifyObj.set(k, v))
5853
amplitude.identify(identifyObj)
5954
}
6055
if (callback) callback()

0 commit comments

Comments
 (0)