File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
app/src/app/overmind/namespaces/editor Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 11import { resolveModule } from '@codesandbox/common/lib/sandbox/modules' ;
2+ import { getHashedUserId } from '@codesandbox/common/lib/utils/analytics' ;
23import {
34 EnvironmentVariable ,
45 ModuleCorrection ,
@@ -122,7 +123,7 @@ export const sandboxChanged: AsyncAction<{ id: string }> = withLoadApp<{
122123
123124 state . editor . isLoading = false ;
124125
125- effects . chameleon . loadTour ( state . user && state . user . id ) ;
126+ effects . chameleon . loadTour ( state . user && getHashedUserId ( state . user . id ) ) ;
126127} ) ;
127128
128129export const contentMounted : Action = ( { state, effects } ) => {
Original file line number Diff line number Diff line change @@ -159,11 +159,15 @@ if (process.env.NODE_ENV === 'production') {
159159 } , 5000 ) ;
160160}
161161
162+ export function getHashedUserId ( userId : string ) {
163+ return hash ( userId ) ;
164+ }
165+
162166export async function setUserId ( userId : string ) {
163167 try {
164168 if ( ! DNT ) {
165169 if ( typeof global . amplitude !== 'undefined' ) {
166- const hashedId = hash ( userId ) ;
170+ const hashedId = getHashedUserId ( userId ) ;
167171 debug ( '[Amplitude] Setting User ID' , hashedId ) ;
168172 identify ( 'userId' , hashedId ) ;
169173
You can’t perform that action at this time.
0 commit comments