@@ -134,25 +134,25 @@ const ApiOptions = ({
134134 useExtensionState ( )
135135
136136 const [ customHeaders , setCustomHeaders ] = useState < [ string , string ] [ ] > ( ( ) => {
137- const headers = apiConfiguration ? .openAiHeaders || { }
137+ const headers = apiConfiguration . openAiHeaders || { }
138138 return Object . entries ( headers )
139139 } )
140140
141141 useEffect ( ( ) => {
142- const propHeaders = apiConfiguration ? .openAiHeaders || { }
142+ const propHeaders = apiConfiguration . openAiHeaders || { }
143143
144144 if ( JSON . stringify ( customHeaders ) !== JSON . stringify ( Object . entries ( propHeaders ) ) ) {
145145 setCustomHeaders ( Object . entries ( propHeaders ) )
146146 }
147- } , [ apiConfiguration ? .openAiHeaders , customHeaders ] )
147+ } , [ apiConfiguration . openAiHeaders , customHeaders ] )
148148
149149 // Helper to convert array of tuples to object (filtering out empty keys).
150150
151151 // Debounced effect to update the main configuration when local
152152 // customHeaders state stabilizes.
153153 useDebounce (
154154 ( ) => {
155- const currentConfigHeaders = apiConfiguration ? .openAiHeaders || { }
155+ const currentConfigHeaders = apiConfiguration . openAiHeaders || { }
156156 const newHeadersObject = convertHeadersToObject ( customHeaders )
157157
158158 // Only update if the processed object is different from the current config.
@@ -161,7 +161,7 @@ const ApiOptions = ({
161161 }
162162 } ,
163163 300 ,
164- [ customHeaders , apiConfiguration ? .openAiHeaders , setApiConfigurationField ] ,
164+ [ customHeaders , apiConfiguration . openAiHeaders , setApiConfigurationField ] ,
165165 )
166166
167167 const [ isAdvancedSettingsOpen , setIsAdvancedSettingsOpen ] = useState ( false )
@@ -197,11 +197,11 @@ const ApiOptions = ({
197197 useZooGatewayRouterModelsSync ( )
198198
199199 const { data : openRouterModelProviders } = useOpenRouterModelProviders (
200- apiConfiguration ? .openRouterModelId ,
201- apiConfiguration ? .openRouterBaseUrl ,
200+ apiConfiguration . openRouterModelId ,
201+ apiConfiguration . openRouterBaseUrl ,
202202 {
203203 enabled :
204- ! ! apiConfiguration ? .openRouterModelId &&
204+ ! ! apiConfiguration . openRouterModelId &&
205205 routerModels ?. openrouter &&
206206 Object . keys ( routerModels . openrouter ) . length > 1 &&
207207 apiConfiguration . openRouterModelId in routerModels . openrouter ,
@@ -232,8 +232,8 @@ const ApiOptions = ({
232232 vscode . postMessage ( {
233233 type : OpenAiModelsMessageType . requestOpenAiModels ,
234234 values : {
235- baseUrl : apiConfiguration ? .openAiBaseUrl ,
236- apiKey : apiConfiguration ? .openAiApiKey ,
235+ baseUrl : apiConfiguration . openAiBaseUrl ,
236+ apiKey : apiConfiguration . openAiApiKey ,
237237 customHeaders : { } , // Reserved for any additional headers.
238238 openAiHeaders : headerObject ,
239239 } ,
@@ -242,12 +242,12 @@ const ApiOptions = ({
242242 vscode . postMessage ( {
243243 type : OllamaModelsMessageType . requestOllamaModels ,
244244 values : {
245- baseUrl : apiConfiguration ? .ollamaBaseUrl ,
246- apiKey : apiConfiguration ? .ollamaApiKey ,
245+ baseUrl : apiConfiguration . ollamaBaseUrl ,
246+ apiKey : apiConfiguration . ollamaApiKey ,
247247 } ,
248248 } )
249249 } else if ( selectedProvider === providerIdentifiers . lmstudio ) {
250- requestLmStudioModels ( apiConfiguration ? .lmStudioBaseUrl )
250+ requestLmStudioModels ( apiConfiguration . lmStudioBaseUrl )
251251 } else if (
252252 selectedProvider === providerIdentifiers . vscodeLm ||
253253 selectedProvider === providerIdentifiers . githubCopilot
@@ -264,8 +264,8 @@ const ApiOptions = ({
264264 type : RouterModelsMessageType . requestRouterModels ,
265265 values : {
266266 provider : providerIdentifiers . litellm ,
267- litellmApiKey : apiConfiguration ? .litellmApiKey ,
268- litellmBaseUrl : apiConfiguration ? .litellmBaseUrl ,
267+ litellmApiKey : apiConfiguration . litellmApiKey ,
268+ litellmBaseUrl : apiConfiguration . litellmBaseUrl ,
269269 } ,
270270 } )
271271 } else if ( selectedProvider === providerIdentifiers . poe ) {
@@ -278,16 +278,16 @@ const ApiOptions = ({
278278 250 ,
279279 [
280280 selectedProvider ,
281- apiConfiguration ? .requestyApiKey ,
282- apiConfiguration ? .openAiBaseUrl ,
283- apiConfiguration ? .openAiApiKey ,
284- apiConfiguration ? .ollamaBaseUrl ,
285- apiConfiguration ? .ollamaApiKey ,
286- apiConfiguration ? .lmStudioBaseUrl ,
287- apiConfiguration ? .litellmBaseUrl ,
288- apiConfiguration ? .litellmApiKey ,
289- apiConfiguration ? .poeApiKey ,
290- apiConfiguration ? .poeBaseUrl ,
281+ apiConfiguration . requestyApiKey ,
282+ apiConfiguration . openAiBaseUrl ,
283+ apiConfiguration . openAiApiKey ,
284+ apiConfiguration . ollamaBaseUrl ,
285+ apiConfiguration . ollamaApiKey ,
286+ apiConfiguration . lmStudioBaseUrl ,
287+ apiConfiguration . litellmBaseUrl ,
288+ apiConfiguration . litellmApiKey ,
289+ apiConfiguration . poeApiKey ,
290+ apiConfiguration . poeBaseUrl ,
291291 customHeaders ,
292292 ] ,
293293 )
@@ -894,7 +894,7 @@ const ApiOptions = ({
894894 />
895895 { selectedProvider === providerIdentifiers . poe && (
896896 < VSCodeTextField
897- value = { apiConfiguration ? .poeBaseUrl || "" }
897+ value = { apiConfiguration . poeBaseUrl || "" }
898898 onInput = { handleInputChange ( "poeBaseUrl" ) }
899899 placeholder = "https://api.poe.com/v1"
900900 className = "w-full" >
@@ -917,7 +917,7 @@ const ApiOptions = ({
917917 </ div >
918918 < Select
919919 value = {
920- apiConfiguration ? .openRouterSpecificProvider ||
920+ apiConfiguration . openRouterSpecificProvider ||
921921 OPENROUTER_DEFAULT_PROVIDER_NAME
922922 }
923923 onValueChange = { ( value ) =>
0 commit comments