mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
fix(ui): wait for nav api to be ready before loading main app component
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import { Box } from '@invoke-ai/ui-library';
|
||||
import { useStore } from '@nanostores/react';
|
||||
import { GlobalHookIsolator } from 'app/components/GlobalHookIsolator';
|
||||
import { GlobalModalIsolator } from 'app/components/GlobalModalIsolator';
|
||||
import { clearStorage } from 'app/store/enhancers/reduxRemember/driver';
|
||||
import Loading from 'common/components/Loading/Loading';
|
||||
import { AppContent } from 'features/ui/components/AppContent';
|
||||
import { navigationApi } from 'features/ui/layouts/navigation-api';
|
||||
import { memo } from 'react';
|
||||
import { ErrorBoundary } from 'react-error-boundary';
|
||||
|
||||
@@ -16,11 +19,12 @@ const errorBoundaryOnReset = () => {
|
||||
};
|
||||
|
||||
const App = () => {
|
||||
const isNavigationAPIConnected = useStore(navigationApi.$isConnected);
|
||||
return (
|
||||
<ThemeLocaleProvider>
|
||||
<ErrorBoundary onReset={errorBoundaryOnReset} FallbackComponent={AppErrorBoundaryFallback}>
|
||||
<Box id="invoke-app-wrapper" w="100dvw" h="100dvh" position="relative" overflow="hidden">
|
||||
<AppContent />
|
||||
{isNavigationAPIConnected ? <AppContent /> : <Loading />}
|
||||
</Box>
|
||||
<GlobalHookIsolator />
|
||||
<GlobalModalIsolator />
|
||||
|
||||
@@ -34,6 +34,7 @@ export const GlobalHookIsolator = memo(() => {
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
// singleton!
|
||||
useNavigationApi();
|
||||
useReadinessWatcher();
|
||||
useSocketIO();
|
||||
useGlobalModifiersInit();
|
||||
@@ -41,7 +42,6 @@ export const GlobalHookIsolator = memo(() => {
|
||||
useGetOpenAPISchemaQuery();
|
||||
useSyncLoggingConfig();
|
||||
useCloseChakraTooltipsOnDragFix();
|
||||
useNavigationApi();
|
||||
useDndMonitor();
|
||||
useSyncNodeErrors();
|
||||
useSyncLangDirection();
|
||||
|
||||
Reference in New Issue
Block a user