pl-fe: query data cannot be undefined
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
d4b65e905c
commit
fbcd8a58a9
1 changed files with 1 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue