Skip to content

Commit 81dc60f

Browse files
committed
Persist firecrawlApiKey on blur
1 parent 4c19fbd commit 81dc60f

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

webview-ui/src/features/deep-research/GetStarted.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,12 @@ export const GetStarted = () => {
4747
formState: { errors },
4848
} = form
4949

50-
const onSubmit = useCallback(
51-
(data: ResearchSession) => {
52-
// This is the only value we care to persist for now.
53-
setProviderValue("firecrawlApiKey", data.firecrawlApiKey)
54-
setSession(data)
55-
},
56-
[setSession, setProviderValue],
57-
)
50+
const onSubmit = useCallback((data: ResearchSession) => setSession(data), [setSession])
5851

5952
useEffect(() => {
60-
const isProviderValid = provider?.providerId && provider?.providerApiKey && provider?.firecrawlApiKey
6153
setValue("providerId", provider?.providerId ?? ProviderId.OpenRouter)
6254
setValue("providerApiKey", provider?.providerApiKey ?? "")
6355
setValue("firecrawlApiKey", provider?.firecrawlApiKey ?? "")
64-
setIsProvidersOpen(!isProviderValid)
6556
}, [provider, setValue])
6657

6758
useEffect(() => {
@@ -127,6 +118,7 @@ export const GetStarted = () => {
127118
type="password"
128119
placeholder="fc-..."
129120
className="flex-1"
121+
onBlur={() => setProviderValue("firecrawlApiKey", field.value)}
130122
/>
131123
<div className="flex flex-row items-center justify-between gap-2">
132124
<div className="text-muted-foreground">

0 commit comments

Comments
 (0)