Skip to content

Commit 80b7d81

Browse files
committed
fix: only check MCP configuration for selected client on window focus
1 parent 00765c5 commit 80b7d81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

UnityMcpBridge/Editor/Windows/UnityMcpEditorWindow.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ private void OnEnable()
5858

5959
private void OnFocus()
6060
{
61-
// Refresh configuration status when window gains focus
62-
foreach (McpClient mcpClient in mcpClients.clients)
61+
if (mcpClients.clients.Count > 0 && selectedClientIndex < mcpClients.clients.Count)
6362
{
64-
CheckMcpConfiguration(mcpClient);
63+
McpClient selectedClient = mcpClients.clients[selectedClientIndex];
64+
CheckMcpConfiguration(selectedClient);
6565
}
6666
Repaint();
6767
}

0 commit comments

Comments
 (0)