mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
Wait for load before setting background color
This commit is contained in:
parent
b8b8ca9f66
commit
b0bc4c3cf3
3 changed files with 11 additions and 9 deletions
|
|
@ -18,7 +18,7 @@ const AlbumDetailRoute = () => {
|
|||
|
||||
const { albumId } = useParams() as { albumId: string };
|
||||
const detailQuery = useAlbumDetail({ id: albumId });
|
||||
const background = useFastAverageColor(detailQuery.data?.imageUrl);
|
||||
const background = useFastAverageColor(detailQuery.data?.imageUrl, !detailQuery.isLoading);
|
||||
const handlePlayQueueAdd = usePlayQueueAdd();
|
||||
const playButtonBehavior = usePlayButtonBehavior();
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@ const PlaylistDetailRoute = () => {
|
|||
const { playlistId } = useParams() as { playlistId: string };
|
||||
|
||||
const detailQuery = usePlaylistDetail({ id: playlistId });
|
||||
const background = useFastAverageColor(detailQuery?.data?.imageUrl, 'dominant');
|
||||
const background = useFastAverageColor(
|
||||
detailQuery?.data?.imageUrl,
|
||||
!detailQuery?.isLoading,
|
||||
'dominant',
|
||||
);
|
||||
|
||||
const handlePlayQueueAdd = usePlayQueueAdd();
|
||||
const playButtonBehavior = usePlayButtonBehavior();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue