mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
Fix race condition where MCP servers were sent to webview before it was initialized
This commit is contained in:
parent
f938c40539
commit
ceeb33fdc5
4 changed files with 10 additions and 0 deletions
|
|
@ -791,6 +791,10 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|||
}
|
||||
break
|
||||
}
|
||||
case "fetchLatestMcpServersFromHub": {
|
||||
this.mcpHub?.sendLatestMcpServers()
|
||||
break
|
||||
}
|
||||
case "searchCommits": {
|
||||
const cwd = vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath).at(0)
|
||||
if (cwd) {
|
||||
|
|
|
|||
|
|
@ -472,6 +472,10 @@ export class McpHub {
|
|||
})
|
||||
}
|
||||
|
||||
async sendLatestMcpServers() {
|
||||
await this.notifyWebviewOfServerChanges()
|
||||
}
|
||||
|
||||
// Using server
|
||||
|
||||
// Public methods for server management
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ export interface WebviewMessage {
|
|||
| "silentlyRefreshMcpMarketplace"
|
||||
| "searchCommits"
|
||||
| "showMcpView"
|
||||
| "fetchLatestMcpServersFromHub"
|
||||
// | "relaunchChromeDebugMode"
|
||||
text?: string
|
||||
disabled?: boolean
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ const McpView = ({ onDone }: McpViewProps) => {
|
|||
|
||||
useEffect(() => {
|
||||
vscode.postMessage({ type: "silentlyRefreshMcpMarketplace" })
|
||||
vscode.postMessage({ type: "fetchLatestMcpServersFromHub" })
|
||||
}, [])
|
||||
|
||||
// const [servers, setServers] = useState<McpServer[]>([
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue