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

View File

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