Add songs option for default view selector in personal settings #2
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user