mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
Prevent wrong initial color on navigation on the same route
This commit is contained in:
parent
48eaddbeda
commit
853770ea8e
7 changed files with 62 additions and 38 deletions
|
|
@ -122,7 +122,11 @@ export const FullScreenPlayerImage = () => {
|
|||
const { queue } = usePlayerData();
|
||||
const useImageAspectRatio = useFullScreenPlayerStore((state) => state.useImageAspectRatio);
|
||||
const currentSong = queue.current;
|
||||
const background = useFastAverageColor(queue.current?.imageUrl, true, 'dominant');
|
||||
const { color: background } = useFastAverageColor({
|
||||
algorithm: 'dominant',
|
||||
src: queue.current?.imageUrl,
|
||||
srcLoaded: true,
|
||||
});
|
||||
const imageKey = `image-${background}`;
|
||||
|
||||
const [imageState, setImageState] = useSetState({
|
||||
|
|
|
|||
|
|
@ -193,7 +193,11 @@ export const FullScreenPlayer = () => {
|
|||
}, [location, setStore]);
|
||||
|
||||
const currentSong = useCurrentSong();
|
||||
const background = useFastAverageColor(currentSong?.imageUrl, true, 'dominant');
|
||||
const { color: background } = useFastAverageColor({
|
||||
algorithm: 'dominant',
|
||||
src: currentSong?.imageUrl,
|
||||
srcLoaded: true,
|
||||
});
|
||||
|
||||
return (
|
||||
<Container
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue