We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b89c472 commit f06ba00Copy full SHA for f06ba00
1 file changed
src/commands/previewAsset.ts
@@ -121,11 +121,18 @@ function registerPreview(context: vscode.ExtensionContext) {
121
122
/**
123
* Closes all open preview panels when the active environment switches.
124
- * Panels show assets from the old environment and are no longer valid.
+ * Uses the tab groups API so it works regardless of the openPanels tracking state.
125
*/
126
export function resetAllPreviewPanels(): void {
127
- for (const panel of openPanels.values()) {
128
- panel.dispose();
+ for (const tabGroup of vscode.window.tabGroups.all) {
+ for (const tab of tabGroup.tabs) {
129
+ if (
130
+ tab.input instanceof vscode.TabInputWebview &&
131
+ tab.input.viewType === "cloudinaryAssetPreview"
132
+ ) {
133
+ vscode.window.tabGroups.close(tab);
134
+ }
135
136
}
137
138
0 commit comments