mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-24 11:26:32 +02:00
fix list refresh not working on discography/genre pages
This commit is contained in:
@@ -6,6 +6,7 @@ import { useGridRows } from '/@/renderer/components/item-list/helpers/use-grid-r
|
||||
import { useItemListScrollPersist } from '/@/renderer/components/item-list/helpers/use-item-list-scroll-persist';
|
||||
import { ItemGridList } from '/@/renderer/components/item-list/item-grid-list/item-grid-list';
|
||||
import { ItemListGridComponentProps } from '/@/renderer/components/item-list/types';
|
||||
import { useListContext } from '/@/renderer/context/list-context';
|
||||
import { songsQueries } from '/@/renderer/features/songs/api/songs-api';
|
||||
import { useGeneralSettings } from '/@/renderer/store';
|
||||
import { LibraryItem, SongListQuery, SongListSort, SortOrder } from '/@/shared/types/domain-types';
|
||||
@@ -31,10 +32,11 @@ export const SongListInfiniteGrid = ({
|
||||
}) as UseSuspenseQueryOptions<number, Error, number, readonly unknown[]>;
|
||||
|
||||
const listQueryFn = api.controller.getSongList;
|
||||
const { pageKey } = useListContext();
|
||||
|
||||
const { dataVersion, getItem, getItemIndex, itemCount, loadedItems, onRangeChanged } =
|
||||
useItemListInfiniteLoader({
|
||||
eventKey: ItemListKey.SONG,
|
||||
eventKey: pageKey || ItemListKey.SONG,
|
||||
itemsPerPage,
|
||||
itemType: LibraryItem.SONG,
|
||||
listCountQuery,
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useItemListScrollPersist } from '/@/renderer/components/item-list/helpe
|
||||
import { ItemTableList } from '/@/renderer/components/item-list/item-table-list/item-table-list';
|
||||
import { ItemTableListColumn } from '/@/renderer/components/item-list/item-table-list/item-table-list-column';
|
||||
import { ItemListTableComponentProps } from '/@/renderer/components/item-list/types';
|
||||
import { useListContext } from '/@/renderer/context/list-context';
|
||||
import { songsQueries } from '/@/renderer/features/songs/api/songs-api';
|
||||
import { usePlayerSong } from '/@/renderer/store';
|
||||
import { LibraryItem, SongListQuery, SongListSort, SortOrder } from '/@/shared/types/domain-types';
|
||||
@@ -39,10 +40,11 @@ export const SongListInfiniteTable = ({
|
||||
}) as UseSuspenseQueryOptions<number, Error, number, readonly unknown[]>;
|
||||
|
||||
const listQueryFn = api.controller.getSongList;
|
||||
const { pageKey } = useListContext();
|
||||
|
||||
const { getItem, getItemIndex, itemCount, loadedItems, onRangeChanged } =
|
||||
useItemListInfiniteLoader({
|
||||
eventKey: ItemListKey.SONG,
|
||||
eventKey: pageKey || ItemListKey.SONG,
|
||||
itemsPerPage,
|
||||
itemType: LibraryItem.SONG,
|
||||
listCountQuery,
|
||||
|
||||
@@ -7,6 +7,7 @@ import { ItemGridList } from '/@/renderer/components/item-list/item-grid-list/it
|
||||
import { ItemListWithPagination } from '/@/renderer/components/item-list/item-list-pagination/item-list-pagination';
|
||||
import { useItemListPagination } from '/@/renderer/components/item-list/item-list-pagination/use-item-list-pagination';
|
||||
import { ItemListGridComponentProps } from '/@/renderer/components/item-list/types';
|
||||
import { useListContext } from '/@/renderer/context/list-context';
|
||||
import { songsQueries } from '/@/renderer/features/songs/api/songs-api';
|
||||
import { useGeneralSettings } from '/@/renderer/store';
|
||||
import { LibraryItem, SongListQuery, SongListSort, SortOrder } from '/@/shared/types/domain-types';
|
||||
@@ -25,6 +26,7 @@ export const SongListPaginatedGrid = ({
|
||||
serverId,
|
||||
size,
|
||||
}: SongListPaginatedGridProps) => {
|
||||
const { pageKey } = useListContext();
|
||||
const { currentPage, onChange } = useItemListPagination();
|
||||
|
||||
const listCountQuery = songsQueries.listCount({
|
||||
@@ -36,7 +38,7 @@ export const SongListPaginatedGrid = ({
|
||||
|
||||
const { data, pageCount, totalItemCount } = useItemListPaginatedLoader({
|
||||
currentPage,
|
||||
eventKey: ItemListKey.SONG,
|
||||
eventKey: pageKey || ItemListKey.SONG,
|
||||
itemsPerPage,
|
||||
itemType: LibraryItem.SONG,
|
||||
listCountQuery,
|
||||
|
||||
@@ -10,6 +10,7 @@ import { useItemListPagination } from '/@/renderer/components/item-list/item-lis
|
||||
import { ItemTableList } from '/@/renderer/components/item-list/item-table-list/item-table-list';
|
||||
import { ItemTableListColumn } from '/@/renderer/components/item-list/item-table-list/item-table-list-column';
|
||||
import { ItemListTableComponentProps } from '/@/renderer/components/item-list/types';
|
||||
import { useListContext } from '/@/renderer/context/list-context';
|
||||
import { songsQueries } from '/@/renderer/features/songs/api/songs-api';
|
||||
import { usePlayerSong } from '/@/renderer/store';
|
||||
import { LibraryItem, SongListQuery, SongListSort, SortOrder } from '/@/shared/types/domain-types';
|
||||
@@ -35,6 +36,7 @@ export const SongListPaginatedTable = ({
|
||||
serverId,
|
||||
size = 'default',
|
||||
}: SongListPaginatedTableProps) => {
|
||||
const { pageKey } = useListContext();
|
||||
const { currentPage, onChange } = useItemListPagination();
|
||||
|
||||
const listCountQuery = songsQueries.listCount({
|
||||
@@ -46,7 +48,7 @@ export const SongListPaginatedTable = ({
|
||||
|
||||
const { data, pageCount, totalItemCount } = useItemListPaginatedLoader({
|
||||
currentPage,
|
||||
eventKey: ItemListKey.SONG,
|
||||
eventKey: pageKey || ItemListKey.SONG,
|
||||
itemsPerPage,
|
||||
itemType: LibraryItem.SONG,
|
||||
listCountQuery,
|
||||
|
||||
Reference in New Issue
Block a user