Skip to content

Commit

Permalink
tweak: move userUuid querySelector into utility
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahpurcell committed Dec 10, 2024
1 parent 77b0c65 commit a36ad4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 2 additions & 5 deletions assets/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import AppStateWrapper from "./components/appStateWrapper"
import { tagManagerIdentify } from "./helpers/googleTagManager"
import { fullStoryInit } from "./helpers/fullStory"
import inTestGroup, { TestGroups } from "./userInTestGroup"
import { userUuid } from "./util/userUuid"

document.documentElement.dataset.demoMode = inTestGroup(
TestGroups.DemoMode
Expand All @@ -37,11 +38,7 @@ sentryInit(
window.sentryInitialization?.orgSlug
)

const userUuid = document
.querySelector("meta[name=user-uuid]")
?.getAttribute("content")

tagManagerIdentify(userUuid)
tagManagerIdentify(userUuid())

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const root = createRoot(document.getElementById("app")!)
Expand Down
2 changes: 2 additions & 0 deletions assets/src/util/userUuid.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const userUuid = (): string | null | undefined =>
document.querySelector("meta[name=user-uuid]")?.getAttribute("content")

0 comments on commit a36ad4f

Please sign in to comment.