mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
Cleanup
This commit is contained in:
parent
8cb44aa695
commit
d32c5f805e
2 changed files with 6 additions and 5 deletions
|
|
@ -780,7 +780,10 @@ export class Cline {
|
|||
|
||||
async *attemptApiRequest(previousApiReqIndex: number): ApiStream {
|
||||
let mcpHub: McpHub | undefined
|
||||
if (this.providerRef.deref()?.mcpEnabled ?? true) {
|
||||
|
||||
const { mcpEnabled } = await this.providerRef.deref()?.getState() ?? {}
|
||||
|
||||
if (mcpEnabled ?? true) {
|
||||
mcpHub = this.providerRef.deref()?.mcpHub
|
||||
if (!mcpHub) {
|
||||
throw new Error("MCP hub not available")
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|||
private workspaceTracker?: WorkspaceTracker
|
||||
mcpHub?: McpHub
|
||||
private latestAnnouncementId = "dec-10-2024" // update to some unique identifier when we add a new announcement
|
||||
mcpEnabled: boolean = true
|
||||
|
||||
constructor(
|
||||
readonly context: vscode.ExtensionContext,
|
||||
|
|
@ -131,7 +130,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|||
this.workspaceTracker = undefined
|
||||
this.mcpHub?.dispose()
|
||||
this.mcpHub = undefined
|
||||
this.mcpEnabled = true
|
||||
this.outputChannel.appendLine("Disposed all disposables")
|
||||
ClineProvider.activeInstances.delete(this)
|
||||
}
|
||||
|
|
@ -609,8 +607,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|||
break
|
||||
}
|
||||
case "mcpEnabled":
|
||||
this.mcpEnabled = message.bool ?? true
|
||||
await this.updateGlobalState("mcpEnabled", this.mcpEnabled)
|
||||
const mcpEnabled = message.bool ?? true
|
||||
await this.updateGlobalState("mcpEnabled", mcpEnabled)
|
||||
await this.postStateToWebview()
|
||||
break
|
||||
case "playSound":
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue