Show all CAD files in FileTree (#1642)

This commit is contained in:
Frank Noirot
2024-03-05 20:37:48 -05:00
committed by GitHub
parent 23971465ce
commit 9aada41a0d
8 changed files with 95 additions and 39 deletions

View File

@ -50,10 +50,7 @@ export const FileMachineProvider = ({
selectedDirectory: project,
},
actions: {
navigateToFile: (
context: ContextFrom<typeof fileMachine>,
event: EventFrom<typeof fileMachine>
) => {
navigateToFile: (context, event) => {
if (event.data && 'name' in event.data) {
commandBarSend({ type: 'Close' })
navigate(
@ -77,10 +74,7 @@ export const FileMachineProvider = ({
children: newFiles,
}
},
createFile: async (
context: ContextFrom<typeof fileMachine>,
event: EventFrom<typeof fileMachine, 'Create file'>
) => {
createFile: async (context, event) => {
let name = event.data.name.trim() || DEFAULT_FILE_NAME
if (event.data.makeDir) {