Add songs option for default view selector in personal settings #2
@@ -225,6 +225,9 @@ const AlbumList = (props) => {
|
|||||||
const type =
|
const type =
|
||||||
albumListType || localStorage.getItem('defaultView') || defaultAlbumList
|
albumListType || localStorage.getItem('defaultView') || defaultAlbumList
|
||||||
const listParams = albumLists[type]
|
const listParams = albumLists[type]
|
||||||
|
if (type === 'songs') {
|
||||||
|
return <Redirect to="/song" />
|
||||||
|
}
|
||||||
if (type === 'random') {
|
if (type === 'random') {
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,19 @@ import albumLists, { defaultAlbumList } from '../album/albumLists'
|
|||||||
export const SelectDefaultView = (props) => {
|
export const SelectDefaultView = (props) => {
|
||||||
const translate = useTranslate()
|
const translate = useTranslate()
|
||||||
const current = localStorage.getItem('defaultView') || defaultAlbumList
|
const current = localStorage.getItem('defaultView') || defaultAlbumList
|
||||||
const choices = Object.keys(albumLists).map((type) => ({
|
|
||||||
|
const albumChoices = Object.keys(albumLists).map((type) => ({
|
||||||
id: type,
|
id: type,
|
||||||
name: translate(`resources.album.lists.${type}`),
|
name: translate(`resources.album.lists.${type}`),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
const songChoice = {
|
||||||
|
id: 'songs',
|
||||||
|
name: translate('resources.song.name', { smart_count: 2 }),
|
||||||
|
}
|
||||||
|
|
||||||
|
const choices = [...albumChoices, songChoice]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SelectInput
|
<SelectInput
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
Reference in New Issue
Block a user