@@ -5,6 +5,7 @@ import { v4 as uuidv4 } from "uuid";
5
5
import CryptoJS from 'crypto-js' ;
6
6
import { isAndroid , isIOS , isBrowser , isMobile , isMacOs , isWindows } from 'react-device-detect' ;
7
7
import { setCookie } from "cookies-next" ;
8
+ import { STANDARD } from "../constants" ;
8
9
9
10
const LoginContext = createContext ( ) ;
10
11
@@ -17,7 +18,7 @@ export const LoginProvider = ({ children }) => {
17
18
const [ user , setUser ] = useState ( { } ) ;
18
19
const [ email , setEmail ] = useState ( { } ) ;
19
20
const [ enrolledInLaunchClub , setEnrolledInLaunchClub ] = useState ( false ) ;
20
- const [ launchClubStatus , setLaunchClubStatus ] = useState ( "standard" ) ;
21
+ const [ launchClubStatus , setLaunchClubStatus ] = useState ( STANDARD ) ;
21
22
const operatingSystem = isAndroid ? 'Android' : isIOS ? 'iOS' : isWindows ? 'Windows' : isMacOs ? 'macOS' : '' ;
22
23
const device = isMobile ? 'Mobile' : isBrowser ? 'Desktop' : '' ;
23
24
@@ -38,6 +39,7 @@ export const LoginProvider = ({ children }) => {
38
39
context . audience . key = uuidv4 ( ) . slice ( 0 , 10 ) ;
39
40
context . user . launchclub = launchClubStatus ;
40
41
await client ?. identify ( context ) ;
42
+ console . log
41
43
setCookie ( "ld-context" , context ) ;
42
44
setIsLoggedIn ( true ) ;
43
45
setUser ( user ) ;
@@ -55,7 +57,7 @@ export const LoginProvider = ({ children }) => {
55
57
setIsLoggedIn ( false ) ;
56
58
setUser ( "anonymous" ) ;
57
59
setEnrolledInLaunchClub ( false ) ;
58
- setLaunchClubStatus ( "standard" ) ;
60
+ setLaunchClubStatus ( STANDARD ) ;
59
61
const context = await createAnonymousContext ( ) ;
60
62
await client ?. identify ( context ) ;
61
63
setCookie ( "ld-context" , context ) ;
0 commit comments