Skip to content

Commit

Permalink
<fix> Clicking hotplaylist lead undefined error (#1083)
Browse files Browse the repository at this point in the history
This erro caused by the router config makes that when the hotplaylist icon is clicked the params '/' will be seen as "",but there is no exist this provider.
  • Loading branch information
mnyon authored Jun 21, 2023
1 parent 56b4a6e commit 0082d4c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/views/Playlist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const refreshPlaylist = async () => {
};
onMounted(async () => {
listId = route.params.listId;
listId = route.params.listId !== undefined ? route.params.listId : '';
is_favorite = await MediaService.isMyPlaylist(listId);
await refreshPlaylist();
});
Expand Down Expand Up @@ -214,7 +214,12 @@ const addLocalMusic = (listId) => {
watch(
() => route.path,
async () => {
listId = route.params.listId;
listId = route.params.listId !== undefined ? route.params.listId : '';
// when user clicked hotPlaylist then there's no need to refresh
if (listId === '') {
return;
}
// when user clicked myPlaylist
is_favorite = await MediaService.isMyPlaylist(listId);
await refreshPlaylist();
}
Expand Down

0 comments on commit 0082d4c

Please sign in to comment.