From 070dd5e64a55f4d9bd0364169d4b306fa5950b90 Mon Sep 17 00:00:00 2001 From: Chris Griffing Date: Thu, 1 Feb 2024 15:24:19 -0800 Subject: [PATCH] fix: add loading screen while app initializes --- src/App.tsx | 5 + src/components/AppLoader.tsx | 151 ++++++++++++++++++++++++++++ src/components/LoadingErrorPage.tsx | 10 +- src/main.tsx | 9 +- 4 files changed, 167 insertions(+), 8 deletions(-) create mode 100644 src/components/AppLoader.tsx diff --git a/src/App.tsx b/src/App.tsx index 3b91039..3c7daee 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -35,6 +35,7 @@ import { NodeApi, Tree } from "react-arborist"; import { BookWithChapters, BooksCRUD } from "./data/repositories/books"; import { ChapterModel, ChaptersCRUD } from "./data/repositories/chapters"; +import { AppLoader } from "./components/AppLoader"; import { CreateOrUpdateModal } from "./components/CreateOrUpdateModal"; import { SettingsModal } from "./components/SettingsModal"; @@ -99,6 +100,10 @@ export function App() { } }, [whisperModel, openSettingsModal, ready]); + if (!ready) { + return ; + } + return ( <>