From 1b72449496ce3a057a43d002c8042d5e7a1d6576 Mon Sep 17 00:00:00 2001 From: soryu Date: Sat, 7 Feb 2026 16:36:19 +0000 Subject: Add directive init mechanism --- makima/frontend/src/routes/directives.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'makima/frontend/src/routes/directives.tsx') 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} /> ); -- cgit v1.2.3