@@ -484,6 +484,7 @@ export function Config(props: {
484
484
config : ConfigInterface | null ;
485
485
saveConfig : ConfigListProps [ "saveConfig" ] ;
486
486
enterConfig : ( id : string | null ) => void ;
487
+ edit ?: boolean ;
487
488
} ) {
488
489
const [ values , setValues ] = useState (
489
490
props . config ?. config ?? props . configDefaults ,
@@ -537,9 +538,9 @@ export function Config(props: {
537
538
}
538
539
} , [ dropzone . acceptedFiles , setFiles ] ) ;
539
540
const [ inflight , setInflight ] = useState ( false ) ;
540
- const readonly = ! ! props . config && ! inflight ;
541
+ const readonly = ! ! props . config && ! props . edit && ! inflight ;
541
542
542
- const settings = ! props . config ? (
543
+ const settings = ! readonly ? (
543
544
< div className = "flex flex-row gap-4" >
544
545
< div className = "flex flex-row flex-1" >
545
546
< div className = "relative flex flex-grow items-stretch focus-within:z-10" >
@@ -550,6 +551,7 @@ export function Config(props: {
550
551
autoComplete = "off"
551
552
className = "block w-full rounded-none rounded-l-md border-0 py-1.5 pl-4 text-gray-900 ring-1 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6 ring-inset ring-gray-300"
552
553
placeholder = "Name your bot"
554
+ defaultValue = { props . config ?. name }
553
555
/>
554
556
</ div >
555
557
< button
@@ -564,7 +566,7 @@ export function Config(props: {
564
566
</ div >
565
567
) : (
566
568
< >
567
- { props . config . public && (
569
+ { props . config ? .public && (
568
570
< PublicLink assistantId = { props . config ?. assistant_id } />
569
571
) }
570
572
</ >
@@ -585,7 +587,13 @@ export function Config(props: {
585
587
vals . configurable [ "type==agent/tools" ] = [ ...selectedTools ] ;
586
588
setSelectedTools ( [ ] ) ;
587
589
}
588
- const assistantId = await props . saveConfig ( key , vals ! , files , isPublic ) ;
590
+ const assistantId = await props . saveConfig (
591
+ key ,
592
+ vals ! ,
593
+ files ,
594
+ isPublic ,
595
+ props . config ?. assistant_id ,
596
+ ) ;
589
597
props . enterConfig ( assistantId ) ;
590
598
setInflight ( false ) ;
591
599
} }
0 commit comments