mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-18 21:07:44 +03:00
Change default sort for albums view to alphabetically (list) or most recent (grid)
This commit is contained in:
parent
2b06f20f41
commit
3a54246b15
@ -53,7 +53,12 @@ const getPerPageOptions = (width) => {
|
||||
const AlbumList = (props) => {
|
||||
const { width } = props
|
||||
const albumView = useSelector((state) => state.albumView)
|
||||
|
||||
let sort
|
||||
if (albumView.mode === ALBUM_MODE_LIST) {
|
||||
sort = { field: 'name', order: 'ASC' }
|
||||
} else {
|
||||
sort = { field: 'created_at', order: 'DESC' }
|
||||
}
|
||||
return (
|
||||
<List
|
||||
{...props}
|
||||
@ -61,6 +66,7 @@ const AlbumList = (props) => {
|
||||
exporter={false}
|
||||
bulkActionButtons={false}
|
||||
actions={<AlbumListActions />}
|
||||
sort={sort}
|
||||
filters={<AlbumFilter />}
|
||||
perPage={getPerPage(width)}
|
||||
pagination={<Pagination rowsPerPageOptions={getPerPageOptions(width)} />}
|
||||
|
Loading…
x
Reference in New Issue
Block a user