pl-fe: query data cannot be undefined

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-09-27 18:22:02 +02:00
parent d4b65e905c
commit fbcd8a58a9

View file

@ -15,7 +15,7 @@ const useAccountScrobble = (accountId?: string, opts: UseScrobblesOpts = {}) =>
const { data: scrobble, ...result } = useQuery<Scrobble>({
queryKey: ['scrobbles', accountId!],
queryFn: async () => (await client.accounts.getScrobbles(accountId!, { limit: 1 })).items[0],
queryFn: async () => (await client.accounts.getScrobbles(accountId!, { limit: 1 })).items[0] || null,
placeholderData: undefined,
enabled: enabled && !!accountId && features.scrobbles,
staleTime: 3 * 60 * 1000,