« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ui.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui.js b/ui.js
index f686ba9..e6ae644 100644
--- a/ui.js
+++ b/ui.js
@@ -976,8 +976,8 @@ class GrouplikeItemElement extends Button {
           {label: 'Play', action: () => this.emit('play')},
           {label: 'Play next', action: () => this.emit('queue (play next)')},
           {label: 'Play at end', action: () => this.emit('queue (at end)')},
-          {label: 'Play next, shuffled', action: () => this.emit('queue (play next, shuffled)')},
-          {label: 'Play at end, shuffled', action: () => this.emit('queue (at end, shuffled)')}
+          isGroup(this.item) && {label: 'Play next, shuffled', action: () => this.emit('queue (play next, shuffled)')},
+          isGroup(this.item) && {label: 'Play at end, shuffled', action: () => this.emit('queue (at end, shuffled)')}
         ]
       })
     }
@@ -1470,7 +1470,7 @@ class ContextMenu extends FocusElement {
     this.visible = true
 
     // TODO: Actions, that sorta thing
-    for (const { label, action } of items) {
+    for (const { label, action } of items.filter(Boolean)) {
       const button = new Button(label)
       if (action) {
         button.on('pressed', () => {