From fbcd8a58a9852d37eb81267569c0f7529eb574ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Fri, 27 Sep 2024 18:22:02 +0200 Subject: [PATCH] pl-fe: query data cannot be undefined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- packages/pl-fe/src/api/hooks/accounts/useAccountScrobble.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pl-fe/src/api/hooks/accounts/useAccountScrobble.ts b/packages/pl-fe/src/api/hooks/accounts/useAccountScrobble.ts index 2d17cfdfe..bdf568b9c 100644 --- a/packages/pl-fe/src/api/hooks/accounts/useAccountScrobble.ts +++ b/packages/pl-fe/src/api/hooks/accounts/useAccountScrobble.ts @@ -15,7 +15,7 @@ const useAccountScrobble = (accountId?: string, opts: UseScrobblesOpts = {}) => const { data: scrobble, ...result } = useQuery({ 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,