Optimized call to retrieve album songs

This commit is contained in:
Deluan
2020-05-29 16:59:38 -04:00
parent 8f8d992da4
commit a7640c9df4
2 changed files with 13 additions and 18 deletions
+4 -4
View File
@@ -39,15 +39,15 @@ const SongContextMenu = ({
const [anchorEl, setAnchorEl] = useState(null)
const options = {
playNow: {
label: translate('resources.song.actions.playNow'),
label: 'resources.song.actions.playNow',
action: (record) => setTrack(record),
},
addToQueue: {
label: translate('resources.song.actions.addToQueue'),
label: 'resources.song.actions.addToQueue',
action: (record) => addTracks({ [record.id]: record }),
},
addToPlaylist: {
label: translate('resources.song.actions.addToPlaylist'),
label: 'resources.song.actions.addToPlaylist',
action: (record) =>
openAddToPlaylist({
selectedIds: [record.mediaFileId || record.id],
@@ -130,7 +130,7 @@ const SongContextMenu = ({
>
{Object.keys(options).map((key) => (
<MenuItem value={key} key={key} onClick={handleItemClick}>
{options[key].label}
{translate(options[key].label)}
</MenuItem>
))}
</Menu>