Skip to content

Commit 5ca35c0

Browse files
authored
Merge pull request #392 from FloSch62/fixes
Fixes
2 parents b4f028f + 2704899 commit 5ca35c0

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"icon": "resources/containerlab.png",
66
"description": "Manages containerlab topologies in VS Code",
77
"author": "SRL Labs",
8-
"version": "0.19.1",
8+
"version": "0.19.2",
99
"homepage": "https://containerlab.dev/manual/vsc-extension/",
1010
"engines": {
1111
"vscode": "^1.99.0"

src/extension.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ async function openTopoViewerEditorCommand(node?: c.ClabLabTreeNode) {
184184
setCurrentTopoViewer(editor);
185185
editor.lastYamlFilePath = yamlUri.fsPath;
186186
await editor.createWebviewPanel(ctx, yamlUri, labName);
187+
// Ensure the global TopoViewer state tracks the created panel so command callbacks can update it
188+
setCurrentTopoViewer(editor);
187189
if (editor.currentPanel) {
188190
editor.currentPanel.onDidDispose(() => {
189191
setCurrentTopoViewer(undefined);
@@ -214,6 +216,8 @@ async function createTopoViewerTemplateFileCommand() {
214216
try {
215217
await editor.createTemplateFile(uri);
216218
await editor.createWebviewPanel(ctx, uri, labName);
219+
// Update the global viewer reference now that the panel is available
220+
setCurrentTopoViewer(editor);
217221
if (editor.currentPanel) {
218222
editor.currentPanel.onDidDispose(() => {
219223
setCurrentTopoViewer(undefined);
@@ -276,7 +280,8 @@ function onDidChangeConfiguration(e: vscode.ConfigurationChangeEvent) {
276280

277281
function refreshTask() {
278282
ins.update().then(() => {
279-
runningLabsProvider.softRefresh();
283+
localLabsProvider?.refresh();
284+
runningLabsProvider?.softRefresh();
280285
});
281286
}
282287

0 commit comments

Comments
 (0)