mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
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:
parent
d2a54243a8
commit
a83ebd1c98
@ -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 ? (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user