File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,20 @@ import { hydrateRoot } from "react-dom/client";
44import { useLocation , useMatches } from "react-router" ;
55import { HydratedRouter } from "react-router/dom" ;
66
7- import { getPublicEnvVariables } from "cyberstorm/security/publicEnvVariables" ;
7+ import {
8+ getPublicEnvVariables ,
9+ getSessionTools ,
10+ } from "cyberstorm/security/publicEnvVariables" ;
811import { denyUrls } from "cyberstorm/utils/sentry" ;
12+ import { initializeClientDapper } from "cyberstorm/utils/dapperSingleton" ;
913
1014const publicEnvVariables = getPublicEnvVariables ( [
1115 "VITE_SITE_URL" ,
1216 "VITE_BETA_SITE_URL" ,
1317 "VITE_API_URL" ,
1418 "VITE_AUTH_BASE_URL" ,
1519 "VITE_CLIENT_SENTRY_DSN" ,
20+ "VITE_COOKIE_DOMAIN" ,
1621] ) ;
1722
1823Sentry . init ( {
@@ -69,6 +74,16 @@ Sentry.init({
6974 denyUrls,
7075} ) ;
7176
77+ try {
78+ const sessionTools = getSessionTools ( ) ;
79+
80+ initializeClientDapper ( ( ) =>
81+ sessionTools . getConfig ( publicEnvVariables . VITE_API_URL )
82+ ) ;
83+ } catch ( error ) {
84+ Sentry . captureException ( error ) ;
85+ }
86+
7287startTransition ( ( ) => {
7388 hydrateRoot (
7489 document ,
Original file line number Diff line number Diff line change 11import { getSessionContext } from "@thunderstore/ts-api-react/src/SessionContext" ;
2- import { isRecord } from "cyberstorm /utils/typeChecks" ;
2+ import { isRecord } from ".. /utils/typeChecks" ;
33
44export type publicEnvVariablesKeys =
55 | "SITE_URL"
@@ -57,7 +57,7 @@ export function getSessionTools() {
5757 ! publicEnvVariables . VITE_COOKIE_DOMAIN
5858 ) {
5959 throw new Error (
60- "Enviroment variables did not load correctly, please hard refresh page"
60+ "Environment variables did not load correctly, please hard refresh page"
6161 ) ;
6262 }
6363 return getSessionContext (
You can’t perform that action at this time.
0 commit comments