Skip to content

Commit f9dcc36

Browse files
committed
Fix migration
1 parent e5ad879 commit f9dcc36

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

webview-ui/src/components/settings/ApiOptions.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ const ApiOptions = ({
8585
return Object.entries(headers)
8686
})
8787

88+
// Effect to synchronize internal customHeaders state with prop changes
89+
useEffect(() => {
90+
const propHeaders = apiConfiguration?.openAiHeaders || {}
91+
setCustomHeaders(Object.entries(propHeaders))
92+
}, [apiConfiguration?.openAiHeaders])
93+
8894
const [anthropicBaseUrlSelected, setAnthropicBaseUrlSelected] = useState(!!apiConfiguration?.anthropicBaseUrl)
8995
const [azureApiVersionSelected, setAzureApiVersionSelected] = useState(!!apiConfiguration?.azureApiVersion)
9096
const [openRouterBaseUrlSelected, setOpenRouterBaseUrlSelected] = useState(!!apiConfiguration?.openRouterBaseUrl)

0 commit comments

Comments
 (0)