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. 44
      src/components/player/PlayerBar.tsx

44
src/components/player/PlayerBar.tsx

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

Loading…
Cancel
Save