From 3a54246b15fa0904f3a35fe37cdb1918580dd479 Mon Sep 17 00:00:00 2001 From: Deluan Date: Tue, 14 Apr 2020 09:26:59 -0400 Subject: [PATCH] Change default sort for albums view to alphabetically (list) or most recent (grid) --- ui/src/album/AlbumList.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/src/album/AlbumList.js b/ui/src/album/AlbumList.js index ace8a9680..6a6947a0d 100644 --- a/ui/src/album/AlbumList.js +++ b/ui/src/album/AlbumList.js @@ -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 ( { exporter={false} bulkActionButtons={false} actions={} + sort={sort} filters={} perPage={getPerPage(width)} pagination={}