File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/renderer/components/Experiment/Workflows Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ import {
2929 Trash2Icon ,
3030 WorkflowIcon ,
3131} from 'lucide-react' ;
32- import { useState } from 'react' ;
32+ import { useEffect , useState } from 'react' ;
3333
3434import * as chatAPI from '../../../lib/transformerlab-api-sdk' ;
3535import useSWR from 'swr' ;
@@ -75,6 +75,15 @@ export default function Workflows({ experimentInfo }) {
7575 mutate : mutateWorkflows ,
7676 } = useSWR ( chatAPI . Endpoints . Workflows . List ( ) , fetcher ) ;
7777
78+ // select the first workflow available:
79+ useEffect ( ( ) => {
80+ if ( workflowsData && workflowsData . length > 0 ) {
81+ if ( selectedWorkflowId == null && ! newWorkflowModalOpen ) {
82+ setSelectedWorkflowId ( workflowsData [ 0 ] . id ) ;
83+ }
84+ }
85+ } , [ selectedWorkflowId , newWorkflowModalOpen ] ) ;
86+
7887 const workflows = workflowsData ;
7988
8089 const selectedWorkflow = workflows ?. find (
You can’t perform that action at this time.
0 commit comments