Skip to content

Commit e42e5f8

Browse files
Move clearing of TTC project-specific state to SystemIO (#8130)
* Move clearing of TTC project-specific state to SystemIO Out from specific spot in home route into a common navigation utility. * Update snapshots --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent f7fc3b2 commit e42e5f8

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed
5.46 KB
Loading

src/components/Providers/SystemIOProviderDesktop.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ import {
1717
engineCommandManager,
1818
} from '@src/lib/singletons'
1919
import { PromptType, type Prompt } from '@src/lib/prompt'
20-
import { type PromptMeta } from '@src/machines/mlEphantManagerMachine'
20+
import {
21+
MlEphantManagerTransitions,
22+
type PromptMeta,
23+
} from '@src/machines/mlEphantManagerMachine'
2124
import {
2225
useHasListedProjects,
2326
useProjectDirectoryPath,
@@ -84,6 +87,10 @@ export function SystemIOMachineLogicListenerDesktop() {
8487
onFileClose(filePathWithExtension, projectDirectory)
8588
// Open the requested file in the requested project
8689
onFileOpen(requestedFilePathWithExtension, requestedProjectDirectory)
90+
// Clear Text-to-CAD specific state
91+
mlEphantManagerActor.send({
92+
type: MlEphantManagerTransitions.ClearProjectSpecificState,
93+
})
8794

8895
engineCommandManager.rejectAllModelingCommands(
8996
EXECUTE_AST_INTERRUPT_ERROR_MESSAGE

src/routes/Home.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ import {
7474
} from '@src/components/StatusBar/defaultStatusBarItems'
7575
import { useSelector } from '@xstate/react'
7676
import { withSiteBaseURL } from '@src/lib/withBaseURL'
77-
import {
78-
MlEphantManagerStates,
79-
MlEphantManagerTransitions,
80-
} from '@src/machines/mlEphantManagerMachine'
77+
import { MlEphantManagerStates } from '@src/machines/mlEphantManagerMachine'
8178

8279
type ReadWriteProjectState = {
8380
value: boolean
@@ -107,9 +104,6 @@ const Home = () => {
107104
.catch(reportRejection)
108105
}
109106
billingActor.send({ type: BillingTransition.Update, apiToken })
110-
mlEphantManagerActor.send({
111-
type: MlEphantManagerTransitions.ClearProjectSpecificState,
112-
})
113107

114108
// eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: blanket-ignored fix me!
115109
}, [])

0 commit comments

Comments
 (0)