Skip to content

Commit b0839bd

Browse files
committed
Hide actions if update not available
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
1 parent 2decbed commit b0839bd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

webui/main.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ function createKeywordPanel(id, inputKeywords, onUpdate) {
999999
const tree = document.createElement(`vscode-tree`);
10001000
tree.id = id;
10011001

1002-
const actions = [
1002+
const actions = onUpdate ? [
10031003
{
10041004
icon: "edit",
10051005
actionId: "edit",
@@ -1010,7 +1010,7 @@ function createKeywordPanel(id, inputKeywords, onUpdate) {
10101010
actionId: "delete",
10111011
tooltip: "Delete",
10121012
},
1013-
];
1013+
] : [];
10141014

10151015
const icons = {
10161016
branch: 'folder',
@@ -1060,7 +1060,6 @@ function createKeywordPanel(id, inputKeywords, onUpdate) {
10601060
section.appendChild(tree);
10611061

10621062
if (onUpdate) {
1063-
10641063
const newKeyword = document.createElement(`vscode-button`);
10651064
newKeyword.setAttribute(`icon`, `add`);
10661065

@@ -1069,7 +1068,7 @@ function createKeywordPanel(id, inputKeywords, onUpdate) {
10691068
newKeyword.style.display = `block`;
10701069
// TODO: event listener
10711070
const updateButton = document.createElement(`vscode-button`);
1072-
updateButton.innerText = `Update`;
1071+
updateButton.innerText = `Change keyword`;
10731072

10741073
// Center the button
10751074
updateButton.style.margin = `1em`;

0 commit comments

Comments
 (0)