« get me outta code hell

Show "unnamed" in "this group:" (and its menu) - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-12-23 00:01:23 -0400
committerFlorrie <towerofnix@gmail.com>2018-12-23 00:01:23 -0400
commit36332b26b37f3c611d991e83ec5b17ab2a8af082 (patch)
tree0631e6cc590e574246ce467954f8db1cd946bdd8
parent08a5e7805cee34ae50d958dddd262e6954afcf23 (diff)
Show "unnamed" in "this group:" (and its menu)
-rw-r--r--ui.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui.js b/ui.js
index dfb75ae..f5880df 100644
--- a/ui.js
+++ b/ui.js
@@ -254,7 +254,7 @@ class AppElement extends FocusElement {
       items: [
         // A label that just shows some brief information about the item.
         isGroup && {label:
-          `("${item.name}" -` +
+          `(${item.name ? `"${item.name}"` : 'Unnamed'} -` +
           ` ${item.items.length} item${item.items.length === 1 ? '' : 's'}` +
           `, ${countTotalItems(item)} total` +
           ')'},
@@ -976,7 +976,7 @@ class GrouplikeListingElement extends Form {
       // within any groups (so you can't bworse a parent and access its menu
       // from there).
       if (!this.grouplike.isTheQueue) {
-        const ownElement = new BasicGrouplikeItemElement(`This group: ${this.grouplike.name}`)
+        const ownElement = new BasicGrouplikeItemElement(`This group: ${this.grouplike.name || '(Unnamed group)'}`)
         ownElement.item = this.grouplike
         ownElement.recordStore = this.recordStore
         ownElement.isGroup = true