From 56f8dfeb9ef7d4771d8439dc8abbeb73950d3be5 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Sat, 17 Jun 2023 18:19:11 +0200 Subject: [PATCH] Better handling of configuration load --- geneit_app/src/index.tsx | 10 +++++++--- geneit_app/src/widgets/AsyncWidget.tsx | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/geneit_app/src/index.tsx b/geneit_app/src/index.tsx index 324efa0..ec4e8af 100644 --- a/geneit_app/src/index.tsx +++ b/geneit_app/src/index.tsx @@ -13,11 +13,10 @@ import "@fontsource/roboto/700.css"; import { BrowserRouter } from "react-router-dom"; import { ConfirmDialogProvider } from "./widgets/ConfirmDialogProvider"; import { AlertDialogProvider } from "./widgets/AlertDialogProvider"; +import { AsyncWidget } from "./widgets/AsyncWidget"; async function init() { try { - await ServerApi.LoadConfig(); - const root = ReactDOM.createRoot( document.getElementById("root") as HTMLElement ); @@ -28,7 +27,12 @@ async function init() {
- + await ServerApi.LoadConfig()} + errMsg="Echec de la connexion au serveur pour la récupération de la configuration statique !" + build={() => } + />
diff --git a/geneit_app/src/widgets/AsyncWidget.tsx b/geneit_app/src/widgets/AsyncWidget.tsx index ca2c5d9..88fc8ea 100644 --- a/geneit_app/src/widgets/AsyncWidget.tsx +++ b/geneit_app/src/widgets/AsyncWidget.tsx @@ -65,7 +65,7 @@ export function AsyncWidget(p: { {p.errMsg}