diff --git a/web/src/components/Config.jsx b/web/src/components/Config.jsx index a5b41e2..ac38210 100644 --- a/web/src/components/Config.jsx +++ b/web/src/components/Config.jsx @@ -1,5 +1,5 @@ import { useState, useEffect, useCallback } from 'react' -import { User, Brain, RefreshCw, Wrench, Monitor, AlertTriangle, X } from 'lucide-react' +import { User, Brain, RefreshCw, Wrench, Monitor, AlertTriangle } from 'lucide-react' import { useI18n } from '../i18n' const PANELS = [ @@ -311,16 +311,6 @@ function PanelProviders({ providers, editProvider, providerForm, setProviderForm const [validating, setValidating] = useState(null) const [keyStatus, setKeyStatus] = useState({}) - useEffect(() => { - providers.forEach(p => { - if (p.apiKey && !keyStatus[p.name]) { - validateKey(p) - } else if (!p.apiKey) { - setKeyStatus(prev => ({ ...prev, [p.name]: { valid: false, checked: true, error: 'Aucune clé' } })) - } - }) - }, [providers]) - const validateKey = async (p) => { setValidating(p.name) try { @@ -332,6 +322,16 @@ function PanelProviders({ providers, editProvider, providerForm, setProviderForm setValidating(null) } + useEffect(() => { + providers.forEach(p => { + if (p.apiKey && !keyStatus[p.name]) { + validateKey(p) + } else if (!p.apiKey) { + setKeyStatus(prev => ({ ...prev, [p.name]: { valid: false, checked: true, error: 'Aucune clé' } })) + } + }) + }, [providers]) + const handleValidate = async (name, apiKey, model, baseUrl) => { setValidating(name) try { @@ -412,7 +412,7 @@ function PanelUpdates({ updates, tools, checking, updating, needsUpdateCount, in window.dispatchEvent(new CustomEvent('ask-ai-terminal', { detail: { message: `Installe l'outil ${tool} sur mon système. Vérifie d'abord s'il est déjà installé, puis installe-le si nécessaire avec les commandes appropriées.` } })) } - const missingTools = tools.filter(t => !t.installed) + const missingTools = tools.filter(tool => !tool.installed) return ( <>