From 1e713fd4fc718eebf06d810d0d91b53202fa6d76 Mon Sep 17 00:00:00 2001 From: Gitefu <57086297+Gitefu@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:15:02 +0900 Subject: [PATCH] Fix KittyPanel::createOrShow to change an image for each click --- src/KittyPanel.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/KittyPanel.ts b/src/KittyPanel.ts index a1414e6..3f98ca4 100644 --- a/src/KittyPanel.ts +++ b/src/KittyPanel.ts @@ -20,7 +20,6 @@ class KittyPanel { public static async createOrShow(extensionPath: string, secrets: vscode.SecretStorage) { const column = vscode.window.activeTextEditor ? vscode.window.activeTextEditor.viewColumn : undefined; - let configChange = false; let apiKey = await secrets.get("apiKey"); console.log(apiKey); vscode.workspace.onDidChangeConfiguration(async () => { @@ -30,15 +29,12 @@ class KittyPanel { KittyPanel.currentPanel = new KittyPanel(column || vscode.ViewColumn.One, extensionPath, apiKey); console.log("@@@@@@@"); if (currentDocument) { vscode.window.showTextDocument(currentDocument, column);} - configChange = true; } }); if (KittyPanel.currentPanel) { - if (!configChange){ - configChange = false; - KittyPanel.currentPanel._panel.reveal(column); - } + KittyPanel.currentPanel._panel.reveal(column); + KittyPanel.currentPanel._update(); } else { console.log("@@@@"); KittyPanel.currentPanel = new KittyPanel(column || vscode.ViewColumn.One, extensionPath, apiKey);