Skip to content

Commit

Permalink
Rename discoveryMethod to discoverySource
Browse files Browse the repository at this point in the history
  • Loading branch information
ppsreejith committed Nov 10, 2024
1 parent 70c3fed commit f68ac38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions web/src/components/common/Auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function shuffle(array: Array<any>) {
}


const defaultDiscoveryMethods = [
const defaultDiscoverySources = [
{
label: "Instagram",
value: "Instagram",
Expand All @@ -151,7 +151,7 @@ const defaultDiscoveryMethods = [
},
]

shuffle(defaultDiscoveryMethods)
shuffle(defaultDiscoverySources)

const Auth = () => {

Expand All @@ -160,7 +160,7 @@ const Auth = () => {
const [authJWT, setAuthJWT] = useState("");
const [isFirstTimeUser, setIsFirstTimeUser] = useState(false);
const [otp, setOTP] = useState("");
const [discoveryMethod, setDiscoveryMethod] = useState("");
const [discoverySource, setDiscoverySource] = useState("");
const isOTPMode = authJWT ? true : false
const handleVerifyOtp = () => {
if (!otp) {
Expand All @@ -173,7 +173,7 @@ const Auth = () => {
position: 'bottom-right',
})
}
if (isFirstTimeUser && !discoveryMethod) {
if (isFirstTimeUser && !discoverySource) {
return toast({
title: 'Please fill all the fields',
description: "Please tell us how you found us!",
Expand All @@ -183,8 +183,8 @@ const Auth = () => {
position: 'bottom-right',
})
}
if (discoveryMethod) {
captureEvent(GLOBAL_EVENTS.user_discovery_method, { email, discoveryMethod })
if (discoverySource) {
captureEvent(GLOBAL_EVENTS.user_discovery_source, { email, discoverySource })
}
console.log('Login params are', authJWT, otp, session_jwt)
captureEvent(GLOBAL_EVENTS.otp_attempted, { email, otp, authJWT })
Expand All @@ -195,7 +195,7 @@ const Auth = () => {
email,
}))
if (is_new_user) {
captureEvent(GLOBAL_EVENTS.user_signup, { email, profile_id, discoveryMethod })
captureEvent(GLOBAL_EVENTS.user_signup, { email, profile_id, discoverySource })
} else {
captureEvent(GLOBAL_EVENTS.user_login, { email, profile_id })
}
Expand Down Expand Up @@ -313,8 +313,8 @@ const Auth = () => {
chakraStyles={{container: (base) => ({...base, width: "100%"})}}
tagColorScheme="purple"
placeholder="How did you find us?"
onChange={(option) => setDiscoveryMethod(get(option, 'value', ''))}
options={defaultDiscoveryMethods}
onChange={(option) => setDiscoverySource(get(option, 'value', ''))}
options={defaultDiscoverySources}
/>
</> : null
}
Expand Down
2 changes: 1 addition & 1 deletion web/src/tracking/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const GLOBAL_EVENTS = {
"otp_failed": "global/otp_failed",
"otp_success": "global/otp_success",
"user_signup": "global/user_signup",
"user_discovery_method": "global/user_discovery_method",
"user_discovery_source": "global/user_discovery_source",
"user_login": "global/user_login",
"billing_checkout": "global/billing_checkout",
"billing_portal": "global/billing_portal",
Expand Down

0 comments on commit f68ac38

Please sign in to comment.