tangled
alpha
login
or
join now
vielle.dev
/
site
0
fork
atom
Personal Site
0
fork
atom
overview
issues
pulls
pipelines
Sanely type nowPlayingSongID
vielle.dev
7 months ago
b16e5eed
a6b0a787
verified
This commit was signed with the committer's
known signature
.
vielle.dev
SSH Key Fingerprint:
SHA256:/4bvxqoEh9iMdjAPgcgAgXKZZQTROL3ULiPt6nH9RSs=
+1
-4
1 changed file
expand all
collapse all
unified
split
src
components
playing
spotify.ts
+1
-4
src/components/playing/spotify.ts
···
169
169
if (res instanceof Error) return res;
170
170
171
171
// https://developer.spotify.com/documentation/web-api/reference/get-the-users-currently-playing-track
172
172
-
const trackID = (res as { item: { id: string } | null }).item?.id;
173
173
-
if (trackID === null) return null;
174
174
-
175
175
-
return trackID;
172
172
+
return (res as { item: { id: string } | null }).item?.id ?? null;
176
173
}
177
174
178
175
export async function getTrack(id: string) {