diff options
| author | soryu <soryu@soryu.co> | 2026-02-07 16:36:19 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-02-07 16:36:19 +0000 |
| commit | 1b72449496ce3a057a43d002c8042d5e7a1d6576 (patch) | |
| tree | f9151df7cc5128499ee91aafde3ff3c3b3281c1e /makima/frontend/src/routes | |
| parent | 9e9f18884c78c21f5785908fb7ccd00e2fa5436b (diff) | |
| download | soryu-1b72449496ce3a057a43d002c8042d5e7a1d6576.tar.gz soryu-1b72449496ce3a057a43d002c8042d5e7a1d6576.zip | |
Add directive init mechanism
Diffstat (limited to 'makima/frontend/src/routes')
| -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> ); |
