fix: trying to prevent error element unmount on global react components. This is bricking JS state

This commit is contained in:
Kevin Nadro
2025-04-14 11:28:08 -06:00
parent 8f3687106e
commit b3e1326921
5 changed files with 48 additions and 43 deletions

View File

@ -16,15 +16,13 @@ export function SystemIOMachineLogicListener() {
const projectDirectoryPath = useProjectDirectoryPath()
const navigate = useNavigate()
useEffect(() => {
// TODO: use a {requestedProjectName: string} to by pass this clear logic...
if (!requestedProjectName) {return}
if (!requestedProjectName.name) {return}
let projectPathWithoutSpecificKCLFile =
projectDirectoryPath + window.electron.path.sep + requestedProjectName
projectDirectoryPath + window.electron.path.sep + requestedProjectName.name
const requestedPath = `${PATHS.FILE}/${encodeURIComponent(
projectPathWithoutSpecificKCLFile
)}`
navigate(requestedPath)
systemIOActor.send({type:SystemIOMachineEvents.clearRequestedProjectName})
}, [requestedProjectName])
return null
}