mirror of
https://github.com/Jellify-Music/App.git
synced 2026-01-08 20:10:22 -06:00
fix crashes due to type error when using persisted data (#375)
This commit is contained in:
@@ -81,4 +81,6 @@ export enum QueryKeys {
|
||||
StorageInUse = 'StorageInUse',
|
||||
Patrons = 'Patrons',
|
||||
AllArtistsAlphabetical = 'AllArtistsAlphabetical',
|
||||
AllAlbumsAlphabetical = 'AllAlbumsAlphabetical',
|
||||
RecentlyAddedAlbums = 'RecentlyAddedAlbums',
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ const DiscoverContextInitializer = () => {
|
||||
isPending: isPendingRecentlyAdded,
|
||||
isFetchingNextPage: isFetchingNextRecentlyAdded,
|
||||
} = useInfiniteQuery({
|
||||
queryKey: [QueryKeys.RecentlyAdded],
|
||||
queryKey: [QueryKeys.RecentlyAddedAlbums],
|
||||
queryFn: ({ pageParam }) => fetchRecentlyAdded(api, library, pageParam),
|
||||
select: (data) => data.pages.flatMap((page) => page),
|
||||
getNextPageParam: (lastPage, pages) => (lastPage.length > 0 ? pages.length + 1 : undefined),
|
||||
|
||||
@@ -149,7 +149,7 @@ const LibraryContextInitializer = () => {
|
||||
isFetchingNextPage: isFetchingNextAlbumsPage,
|
||||
hasNextPage: hasNextAlbumsPage,
|
||||
} = useInfiniteQuery({
|
||||
queryKey: [QueryKeys.AllAlbums, isFavorites, sortDescending],
|
||||
queryKey: [QueryKeys.AllAlbumsAlphabetical, isFavorites, sortDescending],
|
||||
queryFn: ({ pageParam }) =>
|
||||
fetchAlbums(
|
||||
api,
|
||||
|
||||
Reference in New Issue
Block a user