From aad1e698551d1529fde60694bfa2b3ac7b115542 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Thu, 6 Jun 2024 06:02:50 +0200 Subject: [PATCH] Adjustments on the main.tsx --- src/main.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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

; }