mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-12 05:30:12 +02:00
show loading spinner on refetching
This commit is contained in:
@@ -111,7 +111,7 @@ export const Lyrics = ({ fadeOutNoLyricsMessage = true, settingsKey = 'default'
|
|||||||
const shouldFetchLyrics = !isLyricsDisabled && !!currentSong?._serverId && !!currentSong?.id;
|
const shouldFetchLyrics = !isLyricsDisabled && !!currentSong?._serverId && !!currentSong?.id;
|
||||||
const isWaitingToFetchLyrics = shouldFetchLyrics && pendingSongId !== currentSong?.id;
|
const isWaitingToFetchLyrics = shouldFetchLyrics && pendingSongId !== currentSong?.id;
|
||||||
|
|
||||||
const { data, isFetching, isLoading } = useQuery(
|
const { data, isLoading, isRefetching } = useQuery(
|
||||||
lyricsQueries.songLyrics(
|
lyricsQueries.songLyrics(
|
||||||
{
|
{
|
||||||
options: {
|
options: {
|
||||||
@@ -383,8 +383,7 @@ export const Lyrics = ({ fadeOutNoLyricsMessage = true, settingsKey = 'default'
|
|||||||
}, [data?.local]);
|
}, [data?.local]);
|
||||||
|
|
||||||
const isLoadingLyrics =
|
const isLoadingLyrics =
|
||||||
shouldFetchLyrics &&
|
shouldFetchLyrics && (isWaitingToFetchLyrics || isLoading || isRefetching);
|
||||||
(isWaitingToFetchLyrics || isLoading || (isFetching && !displayLyrics));
|
|
||||||
const hasNoLyrics = !displayLyrics;
|
const hasNoLyrics = !displayLyrics;
|
||||||
const [shouldFadeOut, setShouldFadeOut] = useState(false);
|
const [shouldFadeOut, setShouldFadeOut] = useState(false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user