diff --git a/src/renderer/features/lyrics/lyrics.tsx b/src/renderer/features/lyrics/lyrics.tsx index 1a58f9c42..257ed939b 100644 --- a/src/renderer/features/lyrics/lyrics.tsx +++ b/src/renderer/features/lyrics/lyrics.tsx @@ -108,7 +108,10 @@ export const Lyrics = ({ fadeOutNoLyricsMessage = true, settingsKey = 'default' return queryKeys.songs.lyrics(currentSong._serverId, { songId: currentSong.id }); }, [currentSong]); - const { data, isLoading } = useQuery( + const shouldFetchLyrics = !isLyricsDisabled && !!currentSong?._serverId && !!currentSong?.id; + const isWaitingToFetchLyrics = shouldFetchLyrics && pendingSongId !== currentSong?.id; + + const { data, isFetching, isLoading } = useQuery( lyricsQueries.songLyrics( { options: { @@ -379,7 +382,9 @@ export const Lyrics = ({ fadeOutNoLyricsMessage = true, settingsKey = 'default' return []; }, [data?.local]); - const isLoadingLyrics = isLoading && !isLyricsDisabled; + const isLoadingLyrics = + shouldFetchLyrics && + (isWaitingToFetchLyrics || isLoading || (isFetching && !displayLyrics)); const hasNoLyrics = !displayLyrics; const [shouldFadeOut, setShouldFadeOut] = useState(false); @@ -431,7 +436,7 @@ export const Lyrics = ({ fadeOutNoLyricsMessage = true, settingsKey = 'default' ) : ( {hasNoLyrics ? ( -
+