From f23cc91ef05ac764692294b12117c9c303ebd683 Mon Sep 17 00:00:00 2001 From: ialakey Date: Mon, 17 Jun 2024 21:32:32 +0200 Subject: [PATCH] fixed white screen when trying to open the live demo --- web/src/containers/App/index.tsx | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/web/src/containers/App/index.tsx b/web/src/containers/App/index.tsx index a8255647..9fa6ab1e 100644 --- a/web/src/containers/App/index.tsx +++ b/web/src/containers/App/index.tsx @@ -80,10 +80,35 @@ interface SignInProps { } function SignIn(props: SignInProps) { - const clientId = localStorage.getItem('clientId') || 'sdc-ide'; - authorize(clientId, { nextUrl: props.originPathName }); + useEffect(() => { + const clientId = localStorage.getItem('clientId'); + if (clientId != null) { + authorize(clientId, { nextUrl: props.originPathName }); + } + }, [props.originPathName]); - return null; + const handleAuthorizeClick = () => { + authorize('sdc-ide', { nextUrl: props.originPathName }); + }; + + return ( +
+

Welcome to SDC IDE!

+

+ To launch the IDE on top of EMR, please use the following default login credentials: +
+ Username: admin / receptionist / practitioner1 / practitioner2
+ Password: password +

+

+ Click{' '} + + here + {' '} + to run IDE on top of EMR. +

+
+ ); } export function Auth() {