File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { createLogger } from '@logger';
33import { type Socket , io } from 'socket.io-client' ;
44
55const logger = createLogger ( '[Analytics]' ) ;
6- const ANALYTIC_SERVER_URL = 'https ://analytics.lucid.sanooj.is-a.dev ' ;
6+ const ANALYTIC_SERVER_URL = 'http ://localhost:3000 ' ;
77const USER_ID_LOCAL_KEY = 'lucid:lyrics:userId' ;
88
99type AnalyticType = 'theme' | 'lyrics_extension' | 'glassify_theme' ;
@@ -39,10 +39,8 @@ export async function setupAnalytics(
3939 return ;
4040 }
4141
42- const userId = getUserId ( ) ?? undefined ;
43-
4442 socket = io ( `${ ANALYTIC_SERVER_URL } /ws/users` , {
45- auth : { type : TYPE , userId } ,
43+ auth : { type : TYPE } ,
4644 closeOnBeforeunload : true ,
4745 } ) ;
4846
@@ -57,6 +55,9 @@ export async function setupAnalytics(
5755 const MAX_RETRIES = 3 ;
5856
5957 socket . on ( 'connect' , ( ) => {
58+ const userId = getUserId ( ) ?? undefined ;
59+ socket ?. emit ( 'getUserId' , userId ) ;
60+
6061 logger . info ( 'Connected' ) ;
6162 connectionAttempts = 0 ;
6263 } ) ;
You can’t perform that action at this time.
0 commit comments