From 08d74f292a84afdc32d50212e4f3259061d9b30b Mon Sep 17 00:00:00 2001 From: Phan An Date: Fri, 25 Oct 2024 17:32:40 +0700 Subject: [PATCH] fix: loading state for Playlist (#1862) --- .../js/components/screens/AlbumListScreen.vue | 2 +- .../js/components/screens/AllSongsScreen.vue | 2 +- .../components/screens/ArtistListScreen.vue | 2 +- .../js/components/screens/FavoritesScreen.vue | 2 +- .../js/components/screens/GenreListScreen.vue | 2 +- .../js/components/screens/HomeScreen.vue | 2 +- .../js/components/screens/PlaylistScreen.vue | 66 +++++++++++-------- .../components/screens/PodcastListScreen.vue | 2 +- .../js/components/screens/QueueScreen.vue | 2 +- .../screens/RecentlyPlayedScreen.vue | 2 +- .../screens/search/SearchExcerptsScreen.vue | 2 +- .../components/song/PlayableContextMenu.vue | 2 +- .../assets/js/composables/useSongList.ts | 2 +- 13 files changed, 49 insertions(+), 41 deletions(-) diff --git a/resources/assets/js/components/screens/AlbumListScreen.vue b/resources/assets/js/components/screens/AlbumListScreen.vue index 12e64f48..b33ef790 100644 --- a/resources/assets/js/components/screens/AlbumListScreen.vue +++ b/resources/assets/js/components/screens/AlbumListScreen.vue @@ -14,7 +14,7 @@ No albums found. - + {{ isAdmin ? 'Have you set up your library yet?' : 'Contact your administrator to set up your library.' }} diff --git a/resources/assets/js/components/screens/AllSongsScreen.vue b/resources/assets/js/components/screens/AllSongsScreen.vue index 366107cc..912124a1 100644 --- a/resources/assets/js/components/screens/AllSongsScreen.vue +++ b/resources/assets/js/components/screens/AllSongsScreen.vue @@ -49,7 +49,7 @@ Your library is empty. diff --git a/resources/assets/js/components/screens/ArtistListScreen.vue b/resources/assets/js/components/screens/ArtistListScreen.vue index 4cdf71f1..f9712148 100644 --- a/resources/assets/js/components/screens/ArtistListScreen.vue +++ b/resources/assets/js/components/screens/ArtistListScreen.vue @@ -14,7 +14,7 @@ No artists found. - + {{ isAdmin ? 'Have you set up your library yet?' : 'Contact your administrator to set up your library.' }} diff --git a/resources/assets/js/components/screens/FavoritesScreen.vue b/resources/assets/js/components/screens/FavoritesScreen.vue index 0d874cea..7d9381ba 100644 --- a/resources/assets/js/components/screens/FavoritesScreen.vue +++ b/resources/assets/js/components/screens/FavoritesScreen.vue @@ -51,7 +51,7 @@ No favorites yet. - + Click the    icon to mark a song as favorite. diff --git a/resources/assets/js/components/screens/GenreListScreen.vue b/resources/assets/js/components/screens/GenreListScreen.vue index 68d7c525..90f06aaf 100644 --- a/resources/assets/js/components/screens/GenreListScreen.vue +++ b/resources/assets/js/components/screens/GenreListScreen.vue @@ -9,7 +9,7 @@ No genres found. - + {{ isAdmin ? 'Have you set up your library yet?' : 'Contact your administrator to set up your library.' }} diff --git a/resources/assets/js/components/screens/HomeScreen.vue b/resources/assets/js/components/screens/HomeScreen.vue index 670fa76c..22de80a5 100644 --- a/resources/assets/js/components/screens/HomeScreen.vue +++ b/resources/assets/js/components/screens/HomeScreen.vue @@ -9,7 +9,7 @@ No songs found. - + {{ isAdmin ? 'Have you set up your library yet?' : 'Contact your administrator to set up your library.' }} diff --git a/resources/assets/js/components/screens/PlaylistScreen.vue b/resources/assets/js/components/screens/PlaylistScreen.vue index 544c13d2..994691f3 100644 --- a/resources/assets/js/components/screens/PlaylistScreen.vue +++ b/resources/assets/js/components/screens/PlaylistScreen.vue @@ -1,7 +1,7 @@ - - + + @@ -93,6 +98,7 @@ import SongListSkeleton from '@/components/ui/skeletons/SongListSkeleton.vue' import CollaboratorsBadge from '@/components/playlist/PlaylistCollaboratorsBadge.vue' import PlaylistThumbnail from '@/components/ui/PlaylistThumbnail.vue' import ScreenBase from '@/components/screens/ScreenBase.vue' +import ScreenHeaderSkeleton from '@/components/ui/skeletons/ScreenHeaderSkeleton.vue' const { currentUser } = useAuthorization() const { triggerNotFound, getRouteParam, onScreenActivated } = useRouter() @@ -152,7 +158,9 @@ const fetchDetails = async (refresh = false) => { } try { - [songs.value, collaborators.value] = await Promise.all([ + loading.value = true + + ;[songs.value, collaborators.value] = await Promise.all([ songStore.fetchForPlaylist(playlist.value!, refresh), playlist.value!.is_collaborative ? playlistCollaborationService.fetchCollaborators(playlist.value!) diff --git a/resources/assets/js/components/screens/PodcastListScreen.vue b/resources/assets/js/components/screens/PodcastListScreen.vue index 64f2983d..ea4a9783 100644 --- a/resources/assets/js/components/screens/PodcastListScreen.vue +++ b/resources/assets/js/components/screens/PodcastListScreen.vue @@ -23,7 +23,7 @@ No podcasts found. - Add a podcast to get started. + Add a podcast to get started.
diff --git a/resources/assets/js/components/screens/QueueScreen.vue b/resources/assets/js/components/screens/QueueScreen.vue index 2b737734..700e923e 100644 --- a/resources/assets/js/components/screens/QueueScreen.vue +++ b/resources/assets/js/components/screens/QueueScreen.vue @@ -44,7 +44,7 @@ No songs queued. - + How about playing some random songs? diff --git a/resources/assets/js/components/screens/RecentlyPlayedScreen.vue b/resources/assets/js/components/screens/RecentlyPlayedScreen.vue index 284bd15c..95656c85 100644 --- a/resources/assets/js/components/screens/RecentlyPlayedScreen.vue +++ b/resources/assets/js/components/screens/RecentlyPlayedScreen.vue @@ -41,7 +41,7 @@ No songs recently played. - Start playing to populate this playlist. + Start playing to populate this playlist. diff --git a/resources/assets/js/components/screens/search/SearchExcerptsScreen.vue b/resources/assets/js/components/screens/search/SearchExcerptsScreen.vue index 7728c428..70cda95e 100644 --- a/resources/assets/js/components/screens/search/SearchExcerptsScreen.vue +++ b/resources/assets/js/components/screens/search/SearchExcerptsScreen.vue @@ -19,7 +19,7 @@ Find songs, artists, and albums, - all in one place. + all in one place. diff --git a/resources/assets/js/components/song/PlayableContextMenu.vue b/resources/assets/js/components/song/PlayableContextMenu.vue index 262f8a40..bfb5b5f0 100644 --- a/resources/assets/js/components/song/PlayableContextMenu.vue +++ b/resources/assets/js/components/song/PlayableContextMenu.vue @@ -28,7 +28,7 @@
  • Favorites
  • -