File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
webview-ui/src/components/settings Expand file tree Collapse file tree 1 file changed +12
-1
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 : "" ,
@@ -477,13 +478,23 @@ export const CodeIndexSettings: React.FC<CodeIndexSettingsProps> = ({
477478 </ div >
478479 < div >
479480 < VSCodeTextField
480- value = { codebaseIndexConfig . codebaseIndexQdrantUrl || "http://localhost:6333" }
481+ value = { codebaseIndexConfig . codebaseIndexQdrantUrl ?? DEFAULT_QDRANT_URL }
482+ placeholder = { DEFAULT_QDRANT_URL }
481483 onInput = { ( e : any ) =>
482484 setCachedStateField ( "codebaseIndexConfig" , {
483485 ...codebaseIndexConfig ,
484486 codebaseIndexQdrantUrl : e . target . value ,
485487 } )
486488 }
489+ onBlur = { ( e : any ) => {
490+ // Set default value if field is empty on blur
491+ if ( ! e . target . value ) {
492+ setCachedStateField ( "codebaseIndexConfig" , {
493+ ...codebaseIndexConfig ,
494+ codebaseIndexQdrantUrl : DEFAULT_QDRANT_URL ,
495+ } )
496+ }
497+ } }
487498 style = { { width : "100%" } } > </ VSCodeTextField >
488499 </ div >
489500 </ div >
You can’t perform that action at this time.
0 commit comments