mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
Merge pull request #428 from samhvw8/fix/roo-config-profile
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 handleInputChange = (field: keyof ApiConfiguration) => (event: any) => {
|
||||||
const apiConfig = { ...apiConfiguration, [field]: event.target.value }
|
const apiConfig = { ...apiConfiguration, [field]: event.target.value }
|
||||||
onUpdateApiConfig(apiConfig)
|
onUpdateApiConfig(apiConfig)
|
||||||
setApiConfiguration(apiConfig)
|
// setApiConfiguration(apiConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
const { selectedProvider, selectedModelId, selectedModelInfo } = useMemo(() => {
|
const { selectedProvider, selectedModelId, selectedModelInfo } = useMemo(() => {
|
||||||
|
|||||||
@@ -112,19 +112,19 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
|
|||||||
|
|
||||||
const setListApiConfigMeta = useCallback(
|
const setListApiConfigMeta = useCallback(
|
||||||
(value: ApiConfigMeta[]) => setState((prevState) => ({ ...prevState, listApiConfigMeta: value })),
|
(value: ApiConfigMeta[]) => setState((prevState) => ({ ...prevState, listApiConfigMeta: value })),
|
||||||
[setState],
|
[],
|
||||||
)
|
)
|
||||||
|
|
||||||
const onUpdateApiConfig = useCallback(
|
const onUpdateApiConfig = useCallback((apiConfig: ApiConfiguration) => {
|
||||||
(apiConfig: ApiConfiguration) => {
|
setState((currentState) => {
|
||||||
vscode.postMessage({
|
vscode.postMessage({
|
||||||
type: "upsertApiConfiguration",
|
type: "upsertApiConfiguration",
|
||||||
text: state.currentApiConfigName,
|
text: currentState.currentApiConfigName, // Access latest state
|
||||||
apiConfiguration: apiConfig,
|
apiConfiguration: apiConfig,
|
||||||
})
|
})
|
||||||
},
|
return currentState // No state update needed
|
||||||
[state],
|
})
|
||||||
)
|
}, [])
|
||||||
|
|
||||||
const handleMessage = useCallback(
|
const handleMessage = useCallback(
|
||||||
(event: MessageEvent) => {
|
(event: MessageEvent) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user