mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-15 03:30:39 +03:00
Remove link from songs to artist (when artist has no albums)
This commit is contained in:
parent
48a627885c
commit
023d7bfa8a
@ -14,24 +14,25 @@ export const useGetHandleArtistClick = (width) => {
|
||||
}
|
||||
}
|
||||
|
||||
const songsFilteredByArtist = (artist) => {
|
||||
return `/song?filter={"artist":"${artist}"}`
|
||||
}
|
||||
|
||||
export const ArtistLinkField = withWidth()(
|
||||
({ record, className, width, source }) => {
|
||||
const artistLink = useGetHandleArtistClick(width)
|
||||
|
||||
const id = record[source + 'Id']
|
||||
const link = id ? artistLink(id) : songsFilteredByArtist(record[source])
|
||||
return (
|
||||
<Link
|
||||
to={link}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
className={className}
|
||||
>
|
||||
{record[source]}
|
||||
</Link>
|
||||
<>
|
||||
{id ? (
|
||||
<Link
|
||||
to={artistLink(id)}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
className={className}
|
||||
>
|
||||
{record[source]}
|
||||
</Link>
|
||||
) : (
|
||||
record[source]
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
)
|
||||
|
@ -68,7 +68,7 @@ const Menu = ({ dense = false }) => {
|
||||
const renderResourceMenuItemLink = (resource) => (
|
||||
<MenuItemLink
|
||||
key={resource.name}
|
||||
to={`/${resource.name}?page=1`}
|
||||
to={`/${resource.name}`}
|
||||
activeClassName={classes.active}
|
||||
primaryText={translatedResourceName(resource, translate)}
|
||||
leftIcon={resource.icon || <ViewListIcon />}
|
||||
|
Loading…
x
Reference in New Issue
Block a user