Skip to content

Commit c306e78

Browse files
committed
fix: add radix to parseInt and handle NaN cases
- Add radix parameter (10) to parseInt calls for dimension fields - Handle NaN cases by using || undefined pattern - Fix both Ollama and OpenAI-compatible provider dimension parsing
1 parent ff38328 commit c306e78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

webview-ui/src/components/chat/CodeIndexPopover.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
741741
}
742742
onInput={(e: any) => {
743743
const value = e.target.value
744-
? parseInt(e.target.value)
744+
? parseInt(e.target.value, 10) || undefined
745745
: undefined
746746
updateSetting("codebaseIndexEmbedderModelDimension", value)
747747
}}
@@ -849,7 +849,7 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
849849
}
850850
onInput={(e: any) => {
851851
const value = e.target.value
852-
? parseInt(e.target.value)
852+
? parseInt(e.target.value, 10) || undefined
853853
: undefined
854854
updateSetting("codebaseIndexEmbedderModelDimension", value)
855855
}}

0 commit comments

Comments
 (0)