Skip to content

Commit

Permalink
remove duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmel committed Aug 19, 2024
1 parent 6766ce8 commit ca4626d
Showing 1 changed file with 23 additions and 36 deletions.
59 changes: 23 additions & 36 deletions src/services/kdbTreeProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -557,24 +557,7 @@ export class KdbNode extends TreeItem {
: "";
}

iconPath = {
light: path.join(
__filename,
"..",
"..",
"resources",
"light",
"p-q-connection" + getServerIconState(this.label) + ".svg",
),
dark: path.join(
__filename,
"..",
"..",
"resources",
"dark",
"p-q-connection" + getServerIconState(this.label) + ".svg",
),
};
iconPath = getNamedIconPath("p-q-connection", this.label);

contextValue = this.label; // "root";
}
Expand Down Expand Up @@ -622,24 +605,7 @@ export class InsightsNode extends TreeItem {
: "";
}

iconPath = {
light: path.join(
__filename,
"..",
"..",
"resources",
"light",
"p-insights" + getServerIconState(this.label) + ".svg",
),
dark: path.join(
__filename,
"..",
"..",
"resources",
"dark",
"p-insights" + getServerIconState(this.label) + ".svg",
),
};
iconPath = getNamedIconPath("p-insights", this.label);

contextValue = this.label; // "root";
}
Expand Down Expand Up @@ -861,3 +827,24 @@ export class LabelNode extends TreeItem {
),
};
}

function getNamedIconPath(name: string, label: string) {
return {
light: path.join(
__filename,
"..",
"..",
"resources",
"light",
name + getServerIconState(label) + ".svg",
),
dark: path.join(
__filename,
"..",
"..",
"resources",
"dark",
name + getServerIconState(label) + ".svg",
),
};
}

0 comments on commit ca4626d

Please sign in to comment.