Get rid of type change, improve detection of webview initialization

This commit is contained in:
cte
2025-01-31 16:37:23 -08:00
parent 5fd8d8911a
commit 79c248be2a
2 changed files with 12 additions and 81 deletions

View File

@@ -132,6 +132,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
private static activeInstances: Set<ClineProvider> = new Set()
private disposables: vscode.Disposable[] = []
private view?: vscode.WebviewView | vscode.WebviewPanel
private isViewLaunched = false
private cline?: Cline
private workspaceTracker?: WorkspaceTracker
mcpHub?: McpHub
@@ -396,7 +397,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
)
}
public async postMessageToWebview(message: ExtensionMessage | WebviewMessage) {
public async postMessageToWebview(message: ExtensionMessage) {
await this.view?.webview.postMessage(message)
}
@@ -644,6 +645,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
),
)
this.isViewLaunched = true
break
case "newTask":
// Code that should run in response to the hello message command
@@ -2471,6 +2473,10 @@ export class ClineProvider implements vscode.WebviewViewProvider {
// integration tests
get viewLaunched() {
return this.isViewLaunched
}
get messages() {
return this.cline?.clineMessages || []
}