mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-09 22:31:08 +00:00
fix: input field showed NaN -> annoying UX
This commit is contained in:
parent
a204169f26
commit
83f02d5dc9
1 changed files with 9 additions and 8 deletions
|
|
@ -271,16 +271,17 @@ export const Gemini = ({
|
|||
onValueChange={([value]) => setApiConfigurationField("contextLimit", value)}
|
||||
/>
|
||||
<VSCodeTextField
|
||||
value={(
|
||||
apiConfiguration.contextLimit ??
|
||||
modelInfo?.contextWindow ??
|
||||
1048576
|
||||
).toString()}
|
||||
value={(() => {
|
||||
const val =
|
||||
apiConfiguration.contextLimit ?? modelInfo?.contextWindow ?? 1048576
|
||||
return Number.isNaN(val) ? "" : val.toString()
|
||||
})()}
|
||||
type="text"
|
||||
inputMode="numeric"
|
||||
onInput={handleInputChange("contextLimit", (e) =>
|
||||
parseInt((e as any).target.value, 10),
|
||||
)}
|
||||
onInput={handleInputChange("contextLimit", (e) => {
|
||||
const val = parseInt((e as any).target.value, 10)
|
||||
return Number.isNaN(val) ? undefined : val
|
||||
})}
|
||||
className="w-24"
|
||||
/>
|
||||
<span className="text-sm">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue