mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix(api-config) error when creation of api config
This commit is contained in:
parent
3e303ea22e
commit
9406a273da
2 changed files with 15 additions and 3 deletions
|
|
@ -128,7 +128,10 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage }: ApiOptionsProps) =
|
|||
id="api-provider"
|
||||
value={selectedProvider}
|
||||
onChange={(value: unknown) => {
|
||||
handleInputChange("apiProvider")({
|
||||
handleInputChange(
|
||||
"apiProvider",
|
||||
true,
|
||||
)({
|
||||
target: {
|
||||
value: (value as DropdownOption).value,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ export interface ExtensionStateContextType extends ExtensionState {
|
|||
setEnhancementApiConfigId: (value: string) => void
|
||||
setExperimentEnabled: (id: ExperimentId, enabled: boolean) => void
|
||||
setAutoApprovalEnabled: (value: boolean) => void
|
||||
handleInputChange: (field: keyof ApiConfiguration) => (event: any) => void
|
||||
handleInputChange: (field: keyof ApiConfiguration, softUpdate?: boolean) => (event: any) => void
|
||||
customModes: ModeConfig[]
|
||||
setCustomModes: (value: ModeConfig[]) => void
|
||||
}
|
||||
|
|
@ -142,7 +142,16 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
|
|||
}, [])
|
||||
|
||||
const handleInputChange = useCallback(
|
||||
(field: keyof ApiConfiguration) => (event: any) => {
|
||||
(field: keyof ApiConfiguration, softUpdate?: boolean) => (event: any) => {
|
||||
if (softUpdate === true) {
|
||||
setState((currentState) => {
|
||||
return {
|
||||
...currentState,
|
||||
apiConfiguration: { ...currentState.apiConfiguration, [field]: event.target.value },
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
setState((currentState) => {
|
||||
vscode.postMessage({
|
||||
type: "upsertApiConfiguration",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue