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

Loading…
Cancel
Save