diff --git a/src/main.tsx b/src/main.tsx index 895ed89..afe1e66 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -5,12 +5,11 @@ import { StrictMode, lazy, Suspense } from "react"; const KcLoginThemeApp = lazy(() => import("./login/KcApp")); const KcAccountThemeApp = lazy(() => import("./account/KcApp")); -let { kcContext } = window; // NOTE: This is just to test a specific page when you run `yarn dev` // however the recommended way to develope is to use the Storybook -if (kcContext === undefined) { - kcContext = (await import("./login/PageStory")).getKcContextMock({ +if (window.kcContext === undefined) { + window.kcContext = (await import("./login/PageStory")).getKcContextMock({ pageId: "register.ftl" }); } @@ -19,11 +18,11 @@ createRoot(document.getElementById("root")!).render( {(() => { - switch (kcContext?.themeType) { + switch (window.kcContext?.themeType) { case "login": - return ; + return ; case "account": - return ; + return ; case undefined: return

No Keycloak Context

; }