mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
Fix settings dirty check (#5779)
This commit is contained in:
parent
8c8888a977
commit
0f994fcf22
2 changed files with 11 additions and 3 deletions
|
|
@ -167,10 +167,10 @@ const ApiOptions = ({
|
|||
|
||||
// Update `apiModelId` whenever `selectedModelId` changes.
|
||||
useEffect(() => {
|
||||
if (selectedModelId) {
|
||||
if (selectedModelId && apiConfiguration.apiModelId !== selectedModelId) {
|
||||
setApiConfigurationField("apiModelId", selectedModelId)
|
||||
}
|
||||
}, [selectedModelId, setApiConfigurationField])
|
||||
}, [selectedModelId, setApiConfigurationField, apiConfiguration.apiModelId])
|
||||
|
||||
// Debounced refresh model updates, only executed 250ms after the user
|
||||
// stops typing.
|
||||
|
|
|
|||
|
|
@ -218,7 +218,15 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
|
|||
return prevState
|
||||
}
|
||||
|
||||
setChangeDetected(true)
|
||||
const previousValue = prevState.apiConfiguration?.[field]
|
||||
|
||||
// Don't treat initial sync from undefined to a defined value as a user change
|
||||
// This prevents the dirty state when the component initializes and auto-syncs the model ID
|
||||
const isInitialSync = previousValue === undefined && value !== undefined
|
||||
|
||||
if (!isInitialSync) {
|
||||
setChangeDetected(true)
|
||||
}
|
||||
return { ...prevState, apiConfiguration: { ...prevState.apiConfiguration, [field]: value } }
|
||||
})
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue