Skip to content

Commit

Permalink
fix: null spotify link when track id is null
Browse files Browse the repository at this point in the history
  • Loading branch information
vascYT committed Oct 29, 2023
1 parent 9b2a142 commit ab73035
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/components/DiscordActivity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@ export default function DiscordActivity() {
{activity.listening_to_spotify ? (
<>
Listening to <span className="mr-[1.5px] font-bold">`</span>
<a
href={`https://open.spotify.com/track/${activity.spotify?.track_id}`}
className="hover:underline"
target="_blank"
rel="noreferrer"
>
{activity.spotify?.song}
</a>
{activity.spotify?.track_id != null ? (
<a
href={`https://open.spotify.com/track/${activity.spotify?.track_id}`}
className="hover:underline"
target="_blank"
rel="noreferrer"
>
{activity.spotify?.song}
</a>
) : (
activity.spotify?.song
)}
<span className="ml-[1.5px] font-bold">`</span>
</>
) : (
Expand Down

0 comments on commit ab73035

Please sign in to comment.