Fix MCP tools count update in plug icon indicator
- Add onMcpToolsUpdate prop to ConversationThread interface - Pass setMcpTools function from ChatApp down to ConversationThread - Connect McpServerModal onToolsUpdate to parent state update - Now plug icon will correctly show '1 (N)' when N tools are available - Fixes issue where tool count remained at 0 despite successful connection
This commit is contained in:
parent
c3624e6bbc
commit
812fdf92e3
2 changed files with 4 additions and 3 deletions
|
|
@ -143,6 +143,7 @@ const ChatApp: React.FC<ChatAppProps> = () => {
|
|||
onModelChange={handleModelChange}
|
||||
apiKeyUpdateTrigger={apiKeyUpdateTrigger}
|
||||
mcpTools={mcpTools}
|
||||
onMcpToolsUpdate={setMcpTools}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ interface ConversationThreadProps {
|
|||
onModelChange: (model: Model) => void
|
||||
apiKeyUpdateTrigger: number
|
||||
mcpTools: Tool[]
|
||||
onMcpToolsUpdate: (tools: Tool[]) => void
|
||||
}
|
||||
|
||||
const ConversationThread: React.FC<ConversationThreadProps> = ({
|
||||
|
|
@ -40,6 +41,7 @@ const ConversationThread: React.FC<ConversationThreadProps> = ({
|
|||
onModelChange,
|
||||
apiKeyUpdateTrigger,
|
||||
mcpTools,
|
||||
onMcpToolsUpdate,
|
||||
}) => {
|
||||
const [input, setInput] = useState<string>('')
|
||||
const [apiKeyModal, setApiKeyModal] = useState<{ isOpen: boolean; model: Model | null }>({
|
||||
|
|
@ -269,9 +271,7 @@ const ConversationThread: React.FC<ConversationThreadProps> = ({
|
|||
<McpServerModal
|
||||
isOpen={mcpServerModal}
|
||||
onClose={() => setMcpServerModal(false)}
|
||||
onToolsUpdate={(tools) => {
|
||||
// This will be handled by the existing MCP tools logic in ChatApp
|
||||
}}
|
||||
onToolsUpdate={onMcpToolsUpdate}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue