diff --git a/src/Router.tsx b/src/Router.tsx index 0c1f3b420..9853f3155 100644 --- a/src/Router.tsx +++ b/src/Router.tsx @@ -12,7 +12,7 @@ import { App } from '@src/App' import { Auth } from '@src/Auth' import { CommandBar } from '@src/components/CommandBar/CommandBar' import { ErrorPage } from '@src/components/ErrorPage' -import FileMachineProvider from '@src/components/FileMachineProvider' +import ModelingPageProvider from '@src/components/ModelingPageProvider' import ModelingMachineProvider from '@src/components/ModelingMachineProvider' import { NetworkContext } from '@src/hooks/useNetworkContext' import { useNetworkStatus } from '@src/hooks/useNetworkStatus' @@ -76,14 +76,14 @@ const router = createRouter([ errorElement: , element: ( - + - + ), children: [ diff --git a/src/components/FileMachineProvider.tsx b/src/components/ModelingPageProvider.tsx similarity index 86% rename from src/components/FileMachineProvider.tsx rename to src/components/ModelingPageProvider.tsx index 584e5c101..fdd4524b6 100644 --- a/src/components/FileMachineProvider.tsx +++ b/src/components/ModelingPageProvider.tsx @@ -16,7 +16,13 @@ import { useSettings, useToken } from '@src/lib/singletons' import { commandBarActor } from '@src/lib/singletons' import { modelingMenuCallbackMostActions } from '@src/menu/register' -export const FileMachineProvider = ({ +/** + * FileMachineProvider moved to ModelingPageProvider. + * This is a root provider for the modeling page to initialize any react code required for the run + * time of the modeling page. + */ + +export const ModelingPageProvider = ({ children, }: { children: React.ReactNode @@ -63,7 +69,7 @@ export const FileMachineProvider = ({ markOnce('code/didLoadFile') }, []) - // Due to the route provider, i've moved this to the FileMachineProvider instead of CommandBarProvider + // Due to the route provider, i've moved this to the ModelingPageProvider instead of CommandBarProvider // This will register the commands to route to Telemetry, Home, and Settings. useEffect(() => { const filePath = @@ -97,16 +103,6 @@ export const FileMachineProvider = ({ }, }) } - - // TODO: KEVIN DELETE - // // GOTCHA: If we call navigate() while in the /file route the fileMachineProvider - // // has a context.project of the original one that was loaded. It does not update - // // Watch when the navigation changes, if it changes set a new Project within the fileMachine - // // to load the latest state of the project you are in. - // if (project) { - // // TODO: Clean this up with global application state when fileMachine gets merged into SystemIOMachine - // send({ type: 'Refresh with new project', data: { project } }) - // } }, [location]) const cb = modelingMenuCallbackMostActions( @@ -176,4 +172,4 @@ export const FileMachineProvider = ({ return
{children}
} -export default FileMachineProvider +export default ModelingPageProvider