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:
Deluan
2026-03-17 20:49:35 -04:00
parent d2a54243a8
commit a83ebd1c98
+10 -1
View File
@@ -10,6 +10,7 @@ import {
ReferenceArrayInput,
ReferenceInput,
SearchInput,
useListContext,
usePermissions,
useRefresh,
useTranslate,
@@ -174,6 +175,14 @@ const AlbumListTitle = ({ albumListType }) => {
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 AlbumList = (props) => {
@@ -234,7 +243,7 @@ const AlbumList = (props) => {
actions={<AlbumListActions />}
filters={<AlbumFilter />}
perPage={perPage}
pagination={<Pagination rowsPerPageOptions={perPageOptions} />}
pagination={<AlbumListPagination rowsPerPageOptions={perPageOptions} />}
title={<AlbumListTitle albumListType={albumListType} />}
>
{albumView.grid ? (