File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
webview-ui/src/components/settings Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ export const CodeIndexSettings: React.FC<CodeIndexSettingsProps> = ({
5151 areSettingsCommitted,
5252} ) => {
5353 const { t } = useAppTranslation ( )
54+ const DEFAULT_QDRANT_URL = "http://localhost:6333"
5455 const [ indexingStatus , setIndexingStatus ] = useState ( {
5556 systemStatus : "Standby" ,
5657 message : "" ,
@@ -425,14 +426,23 @@ export const CodeIndexSettings: React.FC<CodeIndexSettingsProps> = ({
425426 </ div >
426427 < div >
427428 < VSCodeTextField
428- value = { codebaseIndexConfig . codebaseIndexQdrantUrl || "" }
429- placeholder = "http://localhost:6333"
429+ value = { codebaseIndexConfig . codebaseIndexQdrantUrl ?? DEFAULT_QDRANT_URL }
430+ placeholder = { DEFAULT_QDRANT_URL }
430431 onInput = { ( e : any ) =>
431432 setCachedStateField ( "codebaseIndexConfig" , {
432433 ...codebaseIndexConfig ,
433434 codebaseIndexQdrantUrl : e . target . value ,
434435 } )
435436 }
437+ onBlur = { ( e : any ) => {
438+ // Set default value if field is empty on blur
439+ if ( ! e . target . value ) {
440+ setCachedStateField ( "codebaseIndexConfig" , {
441+ ...codebaseIndexConfig ,
442+ codebaseIndexQdrantUrl : DEFAULT_QDRANT_URL ,
443+ } )
444+ }
445+ } }
436446 style = { { width : "100%" } } > </ VSCodeTextField >
437447 </ div >
438448 </ div >
You can’t perform that action at this time.
0 commit comments