Add songs option for default view selector in personal settings #2

Open
arian wants to merge 1 commits from feat/songs-default-view into master
2 changed files with 12 additions and 1 deletions
Showing only changes of commit 8a8a59d7f5 - Show all commits
+3
View File
@@ -225,6 +225,9 @@ const AlbumList = (props) => {
const type =
albumListType || localStorage.getItem('defaultView') || defaultAlbumList
const listParams = albumLists[type]
if (type === 'songs') {
return <Redirect to="/song" />
}
if (type === 'random') {
refresh()
}
+9 -1
View File
@@ -4,11 +4,19 @@ import albumLists, { defaultAlbumList } from '../album/albumLists'
export const SelectDefaultView = (props) => {
const translate = useTranslate()
const current = localStorage.getItem('defaultView') || defaultAlbumList
const choices = Object.keys(albumLists).map((type) => ({
const albumChoices = Object.keys(albumLists).map((type) => ({
id: type,
name: translate(`resources.album.lists.${type}`),
}))
const songChoice = {
id: 'songs',
name: translate('resources.song.name', { smart_count: 2 }),
}
const choices = [...albumChoices, songChoice]
return (
<SelectInput
{...props}