mirror of
https://github.com/jeffvli/sonixd.git
synced 2026-05-01 11:42:37 -04:00
Fix null album/artist navigation
Adds a check before trying to navigate to album/artist page
This commit is contained in:
@@ -406,15 +406,21 @@ const PlayerBar = () => {
|
||||
>
|
||||
<LinkButton
|
||||
tabIndex={0}
|
||||
onClick={() =>
|
||||
history.push(
|
||||
`/library/album/${
|
||||
playQueue[currentEntryList][
|
||||
playQueue.currentIndex
|
||||
]?.albumId
|
||||
}`
|
||||
)
|
||||
}
|
||||
onClick={() => {
|
||||
if (
|
||||
playQueue[currentEntryList][
|
||||
playQueue.currentIndex
|
||||
]?.albumId
|
||||
) {
|
||||
history.push(
|
||||
`/library/album/${
|
||||
playQueue[currentEntryList][
|
||||
playQueue.currentIndex
|
||||
]?.albumId
|
||||
}`
|
||||
);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{playQueue[currentEntryList][playQueue.currentIndex]
|
||||
?.title || 'Unknown title'}
|
||||
@@ -448,13 +454,19 @@ const PlayerBar = () => {
|
||||
tabIndex={0}
|
||||
subtitle="true"
|
||||
onClick={() => {
|
||||
history.push(
|
||||
`/library/artist/${
|
||||
playQueue[currentEntryList][
|
||||
playQueue.currentIndex
|
||||
]?.artistId
|
||||
}`
|
||||
);
|
||||
if (
|
||||
playQueue[currentEntryList][
|
||||
playQueue.currentIndex
|
||||
]?.artistId
|
||||
) {
|
||||
history.push(
|
||||
`/library/artist/${
|
||||
playQueue[currentEntryList][
|
||||
playQueue.currentIndex
|
||||
]?.artistId
|
||||
}`
|
||||
);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{playQueue[currentEntryList][playQueue.currentIndex]
|
||||
|
||||
Reference in New Issue
Block a user