mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-12 23:01:21 +00:00
Fix bug
This commit is contained in:
parent
ce8cdd8dac
commit
dd8214897b
1 changed files with 8 additions and 6 deletions
|
|
@ -12,7 +12,8 @@ export const TemperatureControl = ({ value, onChange, maxValue = 1 }: Temperatur
|
|||
|
||||
// Sync internal state with prop changes when switching profiles
|
||||
useEffect(() => {
|
||||
setIsCustomTemperature(value !== undefined)
|
||||
const hasCustomTemperature = value !== undefined
|
||||
setIsCustomTemperature(hasCustomTemperature)
|
||||
}, [value])
|
||||
|
||||
return (
|
||||
|
|
@ -26,11 +27,12 @@ export const TemperatureControl = ({ value, onChange, maxValue = 1 }: Temperatur
|
|||
<VSCodeCheckbox
|
||||
checked={isCustomTemperature}
|
||||
onChange={(e: any) => {
|
||||
setIsCustomTemperature(e.target.checked)
|
||||
if (!e.target.checked) {
|
||||
onChange(undefined) // Reset to provider default
|
||||
} else {
|
||||
onChange(0) // Set initial value when enabling
|
||||
const isChecked = e.target.checked
|
||||
setIsCustomTemperature(isChecked)
|
||||
if (!isChecked) {
|
||||
onChange(undefined) // Unset the temperature
|
||||
} else if (value !== undefined) {
|
||||
onChange(value) // Use the value from apiConfiguration, if set
|
||||
}
|
||||
}}>
|
||||
<span style={{ fontWeight: "500" }}>Use custom temperature</span>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue