Skip to content

Commit

Permalink
Only show clear secrets button when values present
Browse files Browse the repository at this point in the history
  • Loading branch information
dotNomad committed Sep 24, 2024
1 parent 9741aad commit d303246
Showing 1 changed file with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,21 @@ import Secret from "src/components/views/secrets/Secret.vue";
const home = useHomeStore();
const sectionActions = computed<ActionButton[]>(() => [
{
label: "Clear Values for all Secrets",
codicon: "codicon-clear-all",
fn: () => {
home.secrets.forEach((_, key) => {
home.secrets.set(key, undefined);
});
},
},
]);
const sectionActions = computed<ActionButton[]>(() => {
const result: ActionButton[] = [];
if (home.secretsWithValueCount > 0) {
result.push({
label: "Clear Values for all Secrets",
codicon: "codicon-clear-all",
fn: () => {
home.secrets.forEach((_, key) => {
home.secrets.set(key, undefined);
});
},
});
}
return result;
});
</script>

0 comments on commit d303246

Please sign in to comment.