From a3ca496fa814e7c711b610ced79694e9489dfa4f Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Fri, 27 Mar 2026 11:08:30 -0400 Subject: [PATCH] fix(websearch): narrow provider key handlers for build --- .../settings/sections/websearch/index.tsx | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ui/src/pages/settings/sections/websearch/index.tsx b/ui/src/pages/settings/sections/websearch/index.tsx index f3ee8d22..87538847 100644 --- a/ui/src/pages/settings/sections/websearch/index.tsx +++ b/ui/src/pages/settings/sections/websearch/index.tsx @@ -659,6 +659,7 @@ export default function WebSearchSection() { const enabled = config?.providers?.[provider.id]?.enabled ?? provider.defaultEnabled; const tone = getStatusTone(currentStatus, enabled); + const apiKeyProviderId = isApiKeyProvider(provider.id) ? provider.id : null; return (
- {isApiKeyProvider(provider.id) && ( + {apiKeyProviderId && (
@@ -718,15 +719,15 @@ export default function WebSearchSection() { setApiKeyDrafts((current) => ({ ...current, - [provider.id]: event.target.value, + [apiKeyProviderId]: event.target.value, })) } placeholder={ - config?.apiKeys?.[provider.id]?.configured + config?.apiKeys?.[apiKeyProviderId]?.configured ? 'Enter a new key to rotate the stored secret' : `Paste ${provider.badge}` } @@ -738,24 +739,24 @@ export default function WebSearchSection() { - {(config?.apiKeys?.[provider.id]?.source === 'global_env' || - config?.apiKeys?.[provider.id]?.source === 'both') && ( + {(config?.apiKeys?.[apiKeyProviderId]?.source === 'global_env' || + config?.apiKeys?.[apiKeyProviderId]?.source === 'both') && (