Personal Site

Sanely type nowPlayingSongID

vielle.dev b16e5eed a6b0a787

verified
+1 -4
+1 -4
src/components/playing/spotify.ts
··· 169 if (res instanceof Error) return res; 170 171 // https://developer.spotify.com/documentation/web-api/reference/get-the-users-currently-playing-track 172 - const trackID = (res as { item: { id: string } | null }).item?.id; 173 - if (trackID === null) return null; 174 - 175 - return trackID; 176 } 177 178 export async function getTrack(id: string) {
··· 169 if (res instanceof Error) return res; 170 171 // https://developer.spotify.com/documentation/web-api/reference/get-the-users-currently-playing-track 172 + return (res as { item: { id: string } | null }).item?.id ?? null; 173 } 174 175 export async function getTrack(id: string) {