diff --git a/packages/renderer/src/components/ArtistsInline.tsx b/packages/renderer/src/components/ArtistsInline.tsx index e1883e6..a6b8ca1 100644 --- a/packages/renderer/src/components/ArtistsInline.tsx +++ b/packages/renderer/src/components/ArtistsInline.tsx @@ -10,8 +10,8 @@ const ArtistInline = ({ if (!artists) return
const navigate = useNavigate() - const handleClick = () => { - disableLink ? null : navigate(`/artist/${artists[0].id}`) + const handleClick = (id: number) => { + id !== 0 && !disableLink && navigate(`/artist/${id}`) } return ( @@ -19,7 +19,7 @@ const ArtistInline = ({ {artists.map((artist, index) => ( handleClick(artist.id)} className={classNames({ 'hover:underline': !!artist.id && !disableLink, })} diff --git a/packages/renderer/src/pages/Artist.tsx b/packages/renderer/src/pages/Artist.tsx index 3fe8ded..3ae010f 100644 --- a/packages/renderer/src/pages/Artist.tsx +++ b/packages/renderer/src/pages/Artist.tsx @@ -113,7 +113,7 @@ const Artist = () => {
热门歌曲
-
+
{
{/* Albums */} -
-
专辑
- -
+ {albums.length !== 0 && ( +
+
+ 专辑 +
+ +
+ )} {/* Singles/EP */}