Skip to content

Commit

Permalink
Fix top tracks (#11393)
Browse files Browse the repository at this point in the history
  • Loading branch information
faridsalau authored Feb 16, 2025
1 parent e68da94 commit 0f8fe4a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/common/src/api/tan-query/useTopTags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ export const useTopTags = (
return useQuery({
queryKey: getTopTagsQueryKey(userId),
queryFn: async () => {
const sdk = await audiusSdk()
const { data = [] } = await sdk.users.getTopTrackTags({
id: Id.parse(userId),
limit
})

return data
try {
const sdk = await audiusSdk()
const { data = [] } = await sdk.users.getTopTrackTags({
id: Id.parse(userId),
limit
})
return data
} catch {
return []
}
},
...options,
enabled: options?.enabled !== false
Expand Down

0 comments on commit 0f8fe4a

Please # to comment.