fix(ui): hide pagination during album list loading
Added a custom AlbumListPagination component that returns null while the list is loading, preventing stale pagination controls from appearing alongside the Loading spinner when navigating to the Random album view.
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
|||||||
ReferenceArrayInput,
|
ReferenceArrayInput,
|
||||||
ReferenceInput,
|
ReferenceInput,
|
||||||
SearchInput,
|
SearchInput,
|
||||||
|
useListContext,
|
||||||
usePermissions,
|
usePermissions,
|
||||||
useRefresh,
|
useRefresh,
|
||||||
useTranslate,
|
useTranslate,
|
||||||
@@ -174,6 +175,14 @@ const AlbumListTitle = ({ albumListType }) => {
|
|||||||
return <Title subTitle={title} args={{ smart_count: 2 }} />
|
return <Title subTitle={title} args={{ smart_count: 2 }} />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const AlbumListPagination = (props) => {
|
||||||
|
const { loading } = useListContext()
|
||||||
|
if (loading) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
return <Pagination {...props} />
|
||||||
|
}
|
||||||
|
|
||||||
const randomStartingSeed = Math.random().toString()
|
const randomStartingSeed = Math.random().toString()
|
||||||
|
|
||||||
const AlbumList = (props) => {
|
const AlbumList = (props) => {
|
||||||
@@ -234,7 +243,7 @@ const AlbumList = (props) => {
|
|||||||
actions={<AlbumListActions />}
|
actions={<AlbumListActions />}
|
||||||
filters={<AlbumFilter />}
|
filters={<AlbumFilter />}
|
||||||
perPage={perPage}
|
perPage={perPage}
|
||||||
pagination={<Pagination rowsPerPageOptions={perPageOptions} />}
|
pagination={<AlbumListPagination rowsPerPageOptions={perPageOptions} />}
|
||||||
title={<AlbumListTitle albumListType={albumListType} />}
|
title={<AlbumListTitle albumListType={albumListType} />}
|
||||||
>
|
>
|
||||||
{albumView.grid ? (
|
{albumView.grid ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user