diff options
Diffstat (limited to 'makima/frontend/src/routes/directives.tsx')
| -rw-r--r-- | makima/frontend/src/routes/directives.tsx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/makima/frontend/src/routes/directives.tsx b/makima/frontend/src/routes/directives.tsx index 89535e2..8b82f99 100644 --- a/makima/frontend/src/routes/directives.tsx +++ b/makima/frontend/src/routes/directives.tsx @@ -50,6 +50,7 @@ function DirectivesContent() { fetchDirective, saveDirective, removeDirective, + startDirective, } = useDirectives(); const [selectedDirective, setSelectedDirective] = @@ -114,6 +115,20 @@ function DirectivesContent() { [removeDirective, id, navigate] ); + const handleStart = useCallback( + async (directiveId: string) => { + const ok = await startDirective(directiveId); + if (ok) { + // Refresh the detail view + const updated = await fetchDirective(directiveId); + if (updated) { + setSelectedDirective(updated); + } + } + }, + [startDirective, fetchDirective] + ); + // Detail view if (id) { if (detailLoading) { @@ -136,6 +151,7 @@ function DirectivesContent() { directive={selectedDirective} onBack={handleBack} onDelete={handleDelete} + onStart={handleStart} /> </main> ); |
