From 82dfd7188fae59f5c5009ada09c107070424a618 Mon Sep 17 00:00:00 2001 From: Aleksey_Levin Date: Mon, 8 Jan 2024 15:10:41 +0800 Subject: [PATCH] add timeout to loading page --- frontend/casino/src/main.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/frontend/casino/src/main.tsx b/frontend/casino/src/main.tsx index 057b2ac..1a94a35 100644 --- a/frontend/casino/src/main.tsx +++ b/frontend/casino/src/main.tsx @@ -3,12 +3,17 @@ import ReactDOM from 'react-dom/client' import './index.css' import Loading from "./app/components/Loading/Loading.tsx"; -const App = React.lazy(() => import('./App').then(module => ({ default: module.App }))) +const App = React.lazy(() => + new Promise(( resolve ) => { + setTimeout(async () => { + resolve(import('./App')) + }, 3000) + }).then(module => ({ default: module.App }))) ReactDOM.createRoot(document.getElementById('root')!).render( - - }> - - - , + + }> + + + , )