From 77728c9a8247c8b7f2aca23183d824ee009aaece Mon Sep 17 00:00:00 2001 From: Kees van Kempen Date: Tue, 27 Feb 2024 12:48:52 +0100 Subject: [PATCH] Replace shift shit with array filter Co-Authored-By: Olaf Slomp --- marietje/queues/templates/queues/queue.html | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/marietje/queues/templates/queues/queue.html b/marietje/queues/templates/queues/queue.html index 8087d0b..20db3f8 100644 --- a/marietje/queues/templates/queues/queue.html +++ b/marietje/queues/templates/queues/queue.html @@ -463,12 +463,11 @@ toggle_details(song) { if (!this.show_details(song)) { this.songs_show_details_on_mobile.push(song.id); - } - else { - const index = this.songs_show_details_on_mobile.indexOf(song.id); - if (index > -1) { - this.songs_show_details_on_mobile.splice(index, 1); - } + } else { + // Deze filter is gehaat door Kees, gemaakt door Olaf. Bedankt, Olaf. Duurde wel even. + this.songs_show_details_on_mobile = this.songs_show_details_on_mobile.filter( + value => value !== song.id + ); } }, }