Skip to content

Commit

Permalink
improve code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip-Carneiro-KX committed Aug 16, 2024
1 parent 6d89692 commit a9f9514
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/commands/serverCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ export async function addInsightsConnection(
await updateInsights(insights);
const newInsights = getInsights();
if (newInsights != undefined) {
ext.latestLblsChanged.length = 0;
if (labels && labels.length > 0) {
ext.latestLblsChanged.length = 0;
ext.latestLblsChanged.push(...labels);
await handleLabelsConnMap(labels, insightsData.alias);
}
Expand Down Expand Up @@ -226,8 +226,8 @@ export async function editInsightsConnection(

const newInsights = getInsights();
if (newInsights != undefined) {
ext.latestLblsChanged.length = 0;
if (labels && labels.length > 0) {
ext.latestLblsChanged.length = 0;
ext.latestLblsChanged.push(...labels);
await handleLabelsConnMap(labels, insightsData.alias);
} else {
Expand Down Expand Up @@ -390,8 +390,8 @@ export async function addKdbConnection(
await updateServers(servers);
const newServers = getServers();
if (newServers != undefined) {
ext.latestLblsChanged.length = 0;
if (labels && labels.length > 0) {
ext.latestLblsChanged.length = 0;
ext.latestLblsChanged.push(...labels);
await handleLabelsConnMap(labels, kdbData.serverAlias);
}
Expand Down Expand Up @@ -495,8 +495,8 @@ export async function editKdbConnection(
}
const newServers = getServers();
if (newServers != undefined) {
ext.latestLblsChanged.length = 0;
if (labels && labels.length > 0) {
ext.latestLblsChanged.length = 0;
ext.latestLblsChanged.push(...labels);
await handleLabelsConnMap(labels, kdbData.serverAlias);
} else {
Expand Down
1 change: 0 additions & 1 deletion src/utils/connLabel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ export function isLabelEmpty(name: string) {
export function isLabelContentChanged(name: string) {
const found = ext.latestLblsChanged.find((item) => item === name);
if (found) {
ext.latestLblsChanged.length = 0;
return true;
}
return false;
Expand Down

0 comments on commit a9f9514

Please sign in to comment.