mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
fix: config-manager
This commit is contained in:
@@ -56,7 +56,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage }: ApiOptionsProps) =
|
||||
const handleInputChange = (field: keyof ApiConfiguration) => (event: any) => {
|
||||
const apiConfig = { ...apiConfiguration, [field]: event.target.value }
|
||||
onUpdateApiConfig(apiConfig)
|
||||
setApiConfiguration(apiConfig)
|
||||
// setApiConfiguration(apiConfig)
|
||||
}
|
||||
|
||||
const { selectedProvider, selectedModelId, selectedModelInfo } = useMemo(() => {
|
||||
|
||||
@@ -112,19 +112,19 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
|
||||
|
||||
const setListApiConfigMeta = useCallback(
|
||||
(value: ApiConfigMeta[]) => setState((prevState) => ({ ...prevState, listApiConfigMeta: value })),
|
||||
[setState],
|
||||
[],
|
||||
)
|
||||
|
||||
const onUpdateApiConfig = useCallback(
|
||||
(apiConfig: ApiConfiguration) => {
|
||||
const onUpdateApiConfig = useCallback((apiConfig: ApiConfiguration) => {
|
||||
setState((currentState) => {
|
||||
vscode.postMessage({
|
||||
type: "upsertApiConfiguration",
|
||||
text: state.currentApiConfigName,
|
||||
text: currentState.currentApiConfigName, // Access latest state
|
||||
apiConfiguration: apiConfig,
|
||||
})
|
||||
},
|
||||
[state],
|
||||
)
|
||||
return currentState // No state update needed
|
||||
})
|
||||
}, [])
|
||||
|
||||
const handleMessage = useCallback(
|
||||
(event: MessageEvent) => {
|
||||
|
||||
Reference in New Issue
Block a user