Skip to content

Commit

Permalink
refactor: show commands only if they exist
Browse files Browse the repository at this point in the history
  • Loading branch information
devcatalin committed Oct 5, 2023
1 parent 60665c8 commit ba334c7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/redux/selectors/dryRunsSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,16 @@ export const dryRunNodesSelector = createSelector(
.filter(isDefined)
.sort((a, b) => a.label.localeCompare(b.label));

list.push({type: 'heading', title: 'commands', icon: 'command'});
commands.forEach(command => {
list.push({
type: 'command',
commandId: command.id,
commandName: command.label,
if (commands.length > 0) {
list.push({type: 'heading', title: 'commands', icon: 'command'});
commands.forEach(command => {
list.push({
type: 'command',
commandId: command.id,
commandName: command.label,
});
});
});
}

return list;
}
Expand Down

0 comments on commit ba334c7

Please sign in to comment.