Disable query if no song present

This commit is contained in:
jeffvli 2023-06-03 11:04:47 -07:00 committed by Jeff
parent 3aef2a80a7
commit 782c351ca6

View file

@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from 'react';
import isElectron from 'is-electron';
import { ErrorBoundary } from 'react-error-boundary';
import { ErrorFallback } from '/@/renderer/features/action-required';
import { getServerById, useCurrentServer, useCurrentSong } from '/@/renderer/store';
import { getServerById, useCurrentSong } from '/@/renderer/store';
import { SynchronizedLyrics } from './synchronized-lyrics';
import { UnsynchronizedLyrics } from '/@/renderer/features/lyrics/unsynchronized-lyrics';
import { LyricLine } from '/@/renderer/features/lyrics/lyric-line';
@ -28,6 +28,7 @@ export const Lyrics = () => {
const [songLyrics, setSongLyrics] = useState<LyricsResponse | null>(null);
const remoteLyrics = useSongLyrics({
options: { enabled: !!currentSong },
query: { songId: currentSong?.id ?? '' },
serverId: currentServer?.id,
});