Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ export class ClineProvider
this.view = webviewView

// Set panel reference according to webview type
if ("onDidChangeViewState" in webviewView) {
const inTabMode = "onDidChangeViewState" in webviewView
if (inTabMode) {
// Tag page type
setPanel(webviewView, "tab")
} else if ("onDidChangeVisibility" in webviewView) {
Expand Down Expand Up @@ -441,7 +442,12 @@ export class ClineProvider
// This happens when the user closes the view or when the view is closed programmatically
webviewView.onDidDispose(
async () => {
await this.dispose()
if (inTabMode) {
this.log("Disposing ClineProvider because it was in tab mode.")
await this.dispose()
} else {
this.log("NOT disposing ClineProvider because it is in sidebar mode and can be reused.")
}
},
null,
this.disposables,
Expand Down