mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-11 17:29:37 +02:00
Fix: Chargement modèles IA dans Assistant pour utilisateurs non-admin
Problème: Les modèles IA ne s'affichaient pas dans l'Assistant IA - Settings route nécessite requireAdmin (routes/settings.routes.js:10) - Frontend vérifiait settings.openrouter_api_key avant de charger les modèles - Utilisateurs non-admin ne peuvent jamais récupérer settings - Donc openRouterModels restait toujours vide [] Solution: - Suppression du check settings.openrouter_api_key (Index.tsx:557,263) - Le backend retourne déjà [] si clé API non configurée (fix précédent) - Tous les utilisateurs peuvent maintenant charger les modèles IA Note: L'admin doit configurer la clé API OpenRouter dans Admin → OpenRouter pour que les modèles s'affichent
This commit is contained in:
1 file changed
+5
-5
+5
-5
@@ -260,10 +260,10 @@ const Index = () => {
|
||||
}, [showAdmin]);
|
||||
|
||||
useEffect(() => {
|
||||
if (showAdmin && adminTab === 'openrouter' && settings.openrouter_api_key && openRouterModels.length === 0) {
|
||||
if (showAdmin && adminTab === 'openrouter' && openRouterModels.length === 0) {
|
||||
loadOpenRouterModels();
|
||||
}
|
||||
}, [showAdmin, adminTab, settings.openrouter_api_key]);
|
||||
}, [showAdmin, adminTab]);
|
||||
|
||||
useEffect(() => {
|
||||
if (showAdmin && adminTab === 'calendar') {
|
||||
@@ -552,12 +552,12 @@ const Index = () => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
// Load models when chatbox opens (only if API key is configured)
|
||||
// Load models when chatbox opens
|
||||
useEffect(() => {
|
||||
if (chatOpen && settings.openrouter_api_key && openRouterModels.length === 0) {
|
||||
if (chatOpen && openRouterModels.length === 0) {
|
||||
loadOpenRouterModels();
|
||||
}
|
||||
}, [chatOpen, settings.openrouter_api_key]);
|
||||
}, [chatOpen]);
|
||||
|
||||
// Set default model when models are loaded
|
||||
useEffect(() => {
|
||||
|
||||
Reference in new issue
Block a user