Skip to content

Commit

Permalink
Merge pull request #402 from KxSystems/remove-lbls-when-remove-conn
Browse files Browse the repository at this point in the history
Remove labels when remove conn
  • Loading branch information
Philip-Carneiro-KX authored Aug 15, 2024
2 parents 62a1deb + 6ab6302 commit db77f14
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/commands/serverCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down Expand Up @@ -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 === "");
Expand Down Expand Up @@ -526,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);
}

Expand Down

0 comments on commit db77f14

Please sign in to comment.