Skip to content

Commit

Permalink
fix(GISDK): canvas loading when fetching schema
Browse files Browse the repository at this point in the history
  • Loading branch information
gegenhasi committed Nov 17, 2023
1 parent 4b2e4c9 commit 81f7aca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/gi-sdk/src/Initializer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const Initializer: React.FunctionComponent<IProps> = props => {
service: () => Promise.resolve(null),
};

updateContext(draft => {
draft.isLoading = true;
});

Promise.all([schemaService(), initialService()]).then(([schema, data = { nodes: [], edges: [] }]) => {
updateContext(draft => {
const { nodes, edges } = data;
Expand All @@ -39,6 +43,7 @@ const Initializer: React.FunctionComponent<IProps> = props => {
draft.schemaData = schema as any;
}


const position = isPosition(nodes);
const style = isStyles(nodes);
if (position) {
Expand Down Expand Up @@ -69,6 +74,7 @@ const Initializer: React.FunctionComponent<IProps> = props => {
}
draft.initialized = true;
draft.layoutCache = false;
draft.isLoading = false;
});
});
}, [largeGraphLimit]);
Expand Down

0 comments on commit 81f7aca

Please sign in to comment.