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) { toggle_details(song) {
if (!this.show_details(song)) { if (!this.show_details(song)) {
this.songs_show_details_on_mobile.push(song.id); this.songs_show_details_on_mobile.push(song.id);
} } else {
else { // Deze filter is gehaat door Kees, gemaakt door Olaf. Bedankt, Olaf. Duurde wel even.
const index = this.songs_show_details_on_mobile.indexOf(song.id); this.songs_show_details_on_mobile = this.songs_show_details_on_mobile.filter(
if (index > -1) { value => value !== song.id
this.songs_show_details_on_mobile.splice(index, 1); );
}
} }
}, },
} }