mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-14 12:30:06 +02:00
add refresh button to album / artist carousels
This commit is contained in:
@@ -34,6 +34,7 @@ export const BaseAlbumArtistInfiniteCarousel = (props: AlbumArtistCarouselProps)
|
||||
data: albumArtists,
|
||||
fetchNextPage,
|
||||
hasNextPage,
|
||||
refetch,
|
||||
} = useAlbumArtistListInfinite(sortBy, sortOrder, 20, additionalQuery);
|
||||
|
||||
const controls = useDefaultItemListControls();
|
||||
@@ -65,6 +66,10 @@ export const BaseAlbumArtistInfiniteCarousel = (props: AlbumArtistCarouselProps)
|
||||
|
||||
const handlePrevPage = useCallback(() => {}, []);
|
||||
|
||||
const handleRefresh = useCallback(() => {
|
||||
refetch();
|
||||
}, [refetch]);
|
||||
|
||||
const firstPageItems = excludeIds
|
||||
? albumArtists.pages[0]?.items.filter(
|
||||
(albumArtist) => !excludeIds.includes(albumArtist.id),
|
||||
@@ -82,6 +87,7 @@ export const BaseAlbumArtistInfiniteCarousel = (props: AlbumArtistCarouselProps)
|
||||
loadNextPage={fetchNextPage}
|
||||
onNextPage={handleNextPage}
|
||||
onPrevPage={handlePrevPage}
|
||||
onRefresh={handleRefresh}
|
||||
rowCount={rowCount}
|
||||
title={title}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user