From 3ac620376b410b48bb643001076ff8200ae593ac Mon Sep 17 00:00:00 2001 From: Philip Carneiro Date: Thu, 15 Aug 2024 10:36:56 +0100 Subject: [PATCH 1/2] fix remove conn from labels --- src/commands/serverCommand.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/serverCommand.ts b/src/commands/serverCommand.ts index a277b704..d9377397 100644 --- a/src/commands/serverCommand.ts +++ b/src/commands/serverCommand.ts @@ -192,8 +192,8 @@ export async function editInsightsConnection( } else { const oldKey = getKeyForServerName(oldAlias); const newKey = insightsData.alias; + removeConnFromLabels(oldAlias); if (insights[oldKey] && oldAlias !== insightsData.alias) { - removeConnFromLabels(oldAlias); const uInsights = Object.keys(insights).filter((insight) => { return insight !== oldKey; }); @@ -452,6 +452,7 @@ export async function editKdbConnection( return; } else { const oldKey = getKeyForServerName(oldAlias); + removeConnFromLabels(oldKey); const newKey = kdbData.serverAlias; const removedAuth = editAuth && (kdbData.username === "" || kdbData.password === ""); From 6ab63025e13cb5219a9bcc1fd6d7c5c075126384 Mon Sep 17 00:00:00 2001 From: Philip Carneiro Date: Thu, 15 Aug 2024 10:39:53 +0100 Subject: [PATCH 2/2] remove the labels when the connection is removed --- src/commands/serverCommand.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/commands/serverCommand.ts b/src/commands/serverCommand.ts index d9377397..6c53cb1b 100644 --- a/src/commands/serverCommand.ts +++ b/src/commands/serverCommand.ts @@ -527,6 +527,11 @@ export async function editKdbConnection( export async function removeConnection(viewItem: KdbNode | InsightsNode) { const connMngService = new ConnectionManagementService(); + removeConnFromLabels( + viewItem instanceof KdbNode + ? viewItem.details.serverAlias + : viewItem.details.alias, + ); await connMngService.removeConnection(viewItem); }