« 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.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui.js b/ui.js
index 90fb13a..eb4a0a9 100644
--- a/ui.js
+++ b/ui.js
@@ -503,7 +503,10 @@ class AppElement extends FocusElement {
   }
 
   clearQueue() {
-    this.queueGrouplike.items = []
+    // Clear the queue so that there aren't any items left in it (except for
+    // the track that's currently playing).
+    this.queueGrouplike.items = this.queueGrouplike.items
+      .filter(item => item === this.playingTrack)
     this.queueListingElement.buildItems()
     this.queueListingElement.pathElement.showItem(null)
   }