Browse Source

Fix null album/artist navigation

Adds a check before trying to navigate to album/artist page
master
jeffvli 3 years ago
parent
commit
e1998970e8
  1. 16
      src/components/player/PlayerBar.tsx

16
src/components/player/PlayerBar.tsx

@ -406,15 +406,21 @@ const PlayerBar = () => {
> >
<LinkButton <LinkButton
tabIndex={0} tabIndex={0}
onClick={() => onClick={() => {
if (
playQueue[currentEntryList][
playQueue.currentIndex
]?.albumId
) {
history.push( history.push(
`/library/album/${ `/library/album/${
playQueue[currentEntryList][ playQueue[currentEntryList][
playQueue.currentIndex playQueue.currentIndex
]?.albumId ]?.albumId
}` }`
) );
} }
}}
> >
{playQueue[currentEntryList][playQueue.currentIndex] {playQueue[currentEntryList][playQueue.currentIndex]
?.title || 'Unknown title'} ?.title || 'Unknown title'}
@ -448,6 +454,11 @@ const PlayerBar = () => {
tabIndex={0} tabIndex={0}
subtitle="true" subtitle="true"
onClick={() => { onClick={() => {
if (
playQueue[currentEntryList][
playQueue.currentIndex
]?.artistId
) {
history.push( history.push(
`/library/artist/${ `/library/artist/${
playQueue[currentEntryList][ playQueue[currentEntryList][
@ -455,6 +466,7 @@ const PlayerBar = () => {
]?.artistId ]?.artistId
}` }`
); );
}
}} }}
> >
{playQueue[currentEntryList][playQueue.currentIndex] {playQueue[currentEntryList][playQueue.currentIndex]

Loading…
Cancel
Save