| 245 | const setupReady = setupChecklist.every(item => item.ready); |
| 246 | |
| 247 | async function handleSaveConfig() { |
| 248 | setErrorMessage(null); |
| 249 | try { |
| 250 | if (window.clawDesktop?.setSecret) { |
| 251 | await window.clawDesktop.setSecret('upstreamApiKey', config.upstreamApiKey || ''); |
| 252 | } |
| 253 | await api('/api/config', { |
| 254 | method: 'POST', |
| 255 | body: config, |
| 256 | }); |
| 257 | setConnectionReport(null); |
| 258 | } catch (error) { |
| 259 | setErrorMessage(error instanceof Error ? error.message : String(error)); |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | useEffect(() => { |
| 264 | if (!initialHydrated) { |