fix(web-player): follow the API types where they are nullable
The checked-in schema was stale and typed artist, description and externalId as always present, so the code trusted values the API returns as null. The regenerated schema tells the truth; the API-shaped types now admit null and it is normalised on the way into the player, where the state stays non-null.
This commit is contained in:
@@ -19,7 +19,7 @@ export function targetTitle(target: TrackTarget): string {
|
||||
}
|
||||
|
||||
export function targetArtist(target: TrackTarget): string | undefined {
|
||||
return target.kind === 'youtube' ? target.song.artist : target.track.artist;
|
||||
return (target.kind === 'youtube' ? target.song.artist : target.track.artist) ?? undefined;
|
||||
}
|
||||
|
||||
export function targetExplicit(target: TrackTarget): boolean {
|
||||
|
||||
Reference in New Issue
Block a user