From 92cfd4f8c688cfc5f007dfe43db87094bd8e2b93 Mon Sep 17 00:00:00 2001 From: paulober <44974737+paulober@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:03:25 +0100 Subject: [PATCH] Fix panels not disposed if loading of settings failed Signed-off-by: paulober <44974737+paulober@users.noreply.github.com> --- src/webview/newMicroPythonProjectPanel.mts | 2 ++ src/webview/newProjectPanel.mts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/webview/newMicroPythonProjectPanel.mts b/src/webview/newMicroPythonProjectPanel.mts index 25c4865..3e13f77 100644 --- a/src/webview/newMicroPythonProjectPanel.mts +++ b/src/webview/newMicroPythonProjectPanel.mts @@ -75,6 +75,8 @@ export class NewMicroPythonProjectPanel { const settings = Settings.getInstance(); if (!settings) { + panel.dispose(); + // TODO: maybe add restart button void window.showErrorMessage( "Failed to load settings. Please restart VSCode." diff --git a/src/webview/newProjectPanel.mts b/src/webview/newProjectPanel.mts index bf7976d..a9b2c36 100644 --- a/src/webview/newProjectPanel.mts +++ b/src/webview/newProjectPanel.mts @@ -382,6 +382,8 @@ export class NewProjectPanel { const settings = Settings.getInstance(); if (settings === undefined) { + panel.dispose(); + // TODO: maybe add restart button void window.showErrorMessage( "Failed to load settings. Please restart VSCode."