mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
Add pageIndex on infinite query results
- Result selector runs on every page on every fetch, which means that the uniqueId is not immutable. We need a static index on each item since a playlist can have duplicate song ids
This commit is contained in:
@@ -49,8 +49,8 @@ export const usePlaylistSongListInfinite = (
|
||||
(data: InfiniteData<RawSongListResponse | undefined>) => {
|
||||
return {
|
||||
...data,
|
||||
pages: data.pages.map((page) => {
|
||||
return api.normalize.songList(page, server);
|
||||
pages: data.pages.map((page, index) => {
|
||||
return { ...api.normalize.songList(page, server), pageIndex: index };
|
||||
}),
|
||||
};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user