Skip to content

Commit

Permalink
Merge pull request #4 from chaitanyakole/userId_issue
Browse files Browse the repository at this point in the history
Changes in telemetry service(UserId)
  • Loading branch information
gouravmore authored Jan 6, 2025
2 parents 2d98c62 + b2c0f39 commit 2f6d32d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/services/telemetryService.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { CsTelemetryModule } from "@project-sunbird/client-services/telemetry";
const duration = new Date().getTime();
const userId = localStorage.getItem("userId");

export const initialize = ({ did }) => {
if (!CsTelemetryModule.instance.isInitialised) {
Expand All @@ -16,7 +15,9 @@ export const initialize = ({ did }) => {
channel: process.env.REACT_APP_CHANNEL,
did: did,
authtoken: "",
uid: userId ? userId : "anonymous",
uid: localStorage.getItem("userId")
? localStorage.getItem("userId")
: "anonymous",
sid: "",
batchsize: 1,
mode: "",
Expand Down Expand Up @@ -64,7 +65,9 @@ export const getEventOptions = () => {
pid: "",
},
env: process.env.ENV,
uid: userId ? userId : "anonymous",
uid: localStorage.getItem("userId")
? localStorage.getItem("userId")
: "anonymous",
cdata: [],
rollup: {},
},
Expand Down

0 comments on commit 2f6d32d

Please sign in to comment.