chore: enabling more toast success and error

This commit is contained in:
Kevin Nadro
2025-04-15 10:53:51 -06:00
parent c68718d835
commit 657883e09a
2 changed files with 16 additions and 1 deletions

View File

@ -271,9 +271,11 @@ export const systemIOMachine = setup({
}, },
onDone: { onDone: {
target: SystemIOMachineStates.readingFolders, target: SystemIOMachineStates.readingFolders,
actions: [SystemIOMachineActions.toastSuccess],
}, },
onError: { onError: {
target: SystemIOMachineStates.idle, target: SystemIOMachineStates.idle,
actions: [SystemIOMachineActions.toastError],
}, },
}, },
}, },
@ -290,9 +292,11 @@ export const systemIOMachine = setup({
}, },
onDone: { onDone: {
target: SystemIOMachineStates.readingFolders, target: SystemIOMachineStates.readingFolders,
actions: [SystemIOMachineActions.toastSuccess],
}, },
onError: { onError: {
target: SystemIOMachineStates.idle, target: SystemIOMachineStates.idle,
actions: [SystemIOMachineActions.toastError],
}, },
}, },
}, },
@ -314,6 +318,7 @@ export const systemIOMachine = setup({
}, },
onError: { onError: {
target: SystemIOMachineStates.idle, target: SystemIOMachineStates.idle,
actions: [SystemIOMachineActions.toastError],
}, },
}, },
}, },

View File

@ -118,7 +118,12 @@ export const systemIOMachineDesktop = systemIOMachine.provide({
), ),
newProjectName newProjectName
) )
// DONE
return {
message: `Successfully renamed "${projectName}" to "${newProjectName}"`,
oldName: projectName,
newName: newProjectName,
}
} }
), ),
[SystemIOMachineActors.deleteProject]: fromPromise( [SystemIOMachineActors.deleteProject]: fromPromise(
@ -136,6 +141,11 @@ export const systemIOMachineDesktop = systemIOMachine.provide({
recursive: true, recursive: true,
} }
) )
return {
message: `Successfully deleted "${input.requestedProjectName}"`,
name: input.requestedProjectName,
}
} }
), ),
[SystemIOMachineActors.createKCLFile]: fromPromise( [SystemIOMachineActors.createKCLFile]: fromPromise(