Replace shift shit with array filter

Co-Authored-By: Olaf Slomp <git@oslomp.nl>
This commit is contained in:
2024-02-27 12:48:52 +01:00
parent ad94fe7930
commit 77728c9a82

View File

@ -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
);
}
},
}