diff --git a/src/lib/data-access/store/schemaSlice.ts b/src/lib/data-access/store/schemaSlice.ts index 3fa211bb284cab888d3c8af305d3ed2109f1d327..6c767bc32f06787f175a3dece0b962380c90f613 100644 --- a/src/lib/data-access/store/schemaSlice.ts +++ b/src/lib/data-access/store/schemaSlice.ts @@ -37,7 +37,7 @@ export const initialState: SchemaSliceI = { stats: {}, }, }, - loading: true, + loading: false, error: false, settings: { connectionType: 'connection', diff --git a/src/lib/schema/panel/Schema.tsx b/src/lib/schema/panel/Schema.tsx index da3c9208de14cb1d402eb3e471cd80ac7aa9435f..f687967385c46a09a361330f34a895f86b41b15b 100644 --- a/src/lib/schema/panel/Schema.tsx +++ b/src/lib/schema/panel/Schema.tsx @@ -7,7 +7,14 @@ import { Icon, Panel, TooltipProvider } from '../../components'; import { Button } from '../../components/buttons'; import { Popover, PopoverContent, PopoverTrigger } from '@/lib/components/popover'; import { Tooltip, TooltipContent, TooltipTrigger } from '../../components/tooltip/Tooltip'; -import { useActiveSaveState, useSchema, useSchemaSettings, useSearchResultSchema, wsSchemaRequest } from '../../data-access'; +import { + useActiveSaveState, + useSchema, + useSchemaSettings, + useSearchResultSchema, + useSessionCache, + wsSchemaRequest, +} from '../../data-access'; import { setSchemaLoading, toSchemaGraphology } from '../../data-access/store/schemaSlice'; import { AlgorithmToLayoutProvider, AllLayoutAlgorithms, LayoutFactory } from '../../graph-layout'; import { ConnectionDragLine, ConnectionLine } from '../../querybuilder'; @@ -46,6 +53,7 @@ const edgeTypes = { }; export const Schema = (props: Props) => { + const session = useSessionCache(); const settings = useSchemaSettings(); const activeSaveState = useActiveSaveState(); const searchResults = useSearchResultSchema(); @@ -358,7 +366,9 @@ export const Schema = (props: Props) => { } > <div className="w-full h-full flex flex-col justify-between" ref={reactFlowRef}> - {schema.loading ? ( + {session.currentSaveState == null ? ( + '' + ) : schema.loading ? ( <div className="h-full flex flex-col items-center justify-center"> <Icon component="icon-[mingcute--loading-line]" size={56} className="w-15 h-15 animate-spin " /> </div>