From a3fbfb301a39b3776df66b699fefd6aed8854aa1 Mon Sep 17 00:00:00 2001 From: qixinbo Date: Sun, 29 Mar 2026 23:40:12 +0800 Subject: [PATCH] fix: UI bug fixed --- backend/app/core/nanobot.py | 2 +- frontend/src/components/ChatInterface.tsx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/app/core/nanobot.py b/backend/app/core/nanobot.py index a865c2f..d0ce46b 100644 --- a/backend/app/core/nanobot.py +++ b/backend/app/core/nanobot.py @@ -358,7 +358,7 @@ class NanobotIntegration: if project_id is not None: from app.api.mcp import list_mcp_servers from nanobot.config.schema import MCPServerConfig - servers = list_mcp_servers(project_id=project_id) + servers = await list_mcp_servers(project_id=project_id) for s in servers: cfg = MCPServerConfig( type=s.get("type"), diff --git a/frontend/src/components/ChatInterface.tsx b/frontend/src/components/ChatInterface.tsx index ac82648..ae1ba3d 100644 --- a/frontend/src/components/ChatInterface.tsx +++ b/frontend/src/components/ChatInterface.tsx @@ -747,11 +747,12 @@ export function ChatInterface() { }; const renderActiveSelections = () => { - if (!selectedDataSource && !selectedKnowledgeBaseId) return null; + const hasValidDataSourceSelection = Boolean(selectedDataSource && selectedDataSourceName); + if (!hasValidDataSourceSelection && !selectedKnowledgeBaseId) return null; return (
- {selectedDataSource ? ( + {hasValidDataSourceSelection ? (
{`${t('dataSource')}:${selectedDataSourceName}`}