Skip to content

Commit

Permalink
fix: make array when tracks are valid in playslistpage
Browse files Browse the repository at this point in the history
  • Loading branch information
kimgh06 committed Sep 18, 2024
1 parent d0ec519 commit c452723
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/app/playlist/[...id]/playlistpage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ function PlaylistPages({ trackss, ...props }) {
}
setOriginList(tracks);
let news = []
tracks.forEach(items => {
if (news.indexOf(items.id) === -1) {
news.push(items.id);
}
});
if (tracks) {
tracks.forEach(items => {
if (news.indexOf(items.id) === -1) {
news.push(items.id);
}
});
}
localStorage.setItem('TrackList', `${news}`);
patchItems();
return e => document.removeEventListener('touchmove', func)
Expand Down

0 comments on commit c452723

Please sign in to comment.