From c962c829d8c70c62f52c5fd6145ceaab95d7e425 Mon Sep 17 00:00:00 2001 From: AssisrMatheus Date: Wed, 9 Mar 2022 15:20:22 -0300 Subject: [PATCH] fix: fixes loading when downloading modules --- src/components/Providers/PlannerProvider/index.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Providers/PlannerProvider/index.tsx b/src/components/Providers/PlannerProvider/index.tsx index 2b52dff..b900225 100644 --- a/src/components/Providers/PlannerProvider/index.tsx +++ b/src/components/Providers/PlannerProvider/index.tsx @@ -257,7 +257,7 @@ export const PlannerProvider: React.FC = ({ children, proj const createModule = useCallback( (module: ModuleDataFragment, rulesJson: Record) => { - // setIsPending(true); + setIsPending(true); const parentNanoId = nanoid(); const moduleJson = { @@ -300,12 +300,12 @@ export const PlannerProvider: React.FC = ({ children, proj unityInstance.current?.SendMessage(UNITY_GAME_OBJECT, 'CreateModule', json); }, - [unityInstance] + [unityInstance, setIsPending] ); const createChildrenModule = useCallback( (module: ModuleDataFragment, rulesJson: Record) => { - // setIsPending(true); + setIsPending(true); const moduleJson = { nanoId: nanoid(), @@ -320,7 +320,7 @@ export const PlannerProvider: React.FC = ({ children, proj unityInstance.current?.SendMessage(UNITY_GAME_OBJECT, 'CreateChildrenModule', json); }, - [unityInstance, projectModule] + [unityInstance, projectModule, setIsPending] ); const setupDrawer = useCallback( @@ -655,7 +655,7 @@ export const PlannerProvider: React.FC = ({ children, proj console.log('createModule: ', projectModule, childrenModules); - // setIsPending(false); + setIsPending(false); setProjectModule((prevProjectModule) => updateProjectModuleState(projectModule, prevProjectModule)); setChildrenModules(childrenModules?.children); setState('Created'); @@ -672,7 +672,7 @@ export const PlannerProvider: React.FC = ({ children, proj console.log('selectedModule: ', projectModule, childrenModules); - // setIsPending(false); + setIsPending(false); setProjectModule((prevProjectModule) => updateProjectModuleState(projectModule, prevProjectModule)); setChildrenModules(childrenModules?.children); setState('Selected');