Personal Site
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Store the id of the song in the client messages.

This will be used to prevent rerenders when the song hasn't changed and reduce the chance of unexpected behaviour

+4
+3
src/components/playing/spotify/types.ts
··· 47 47 export type nowPlaying = null | { 48 48 type: "track"; 49 49 name: string; 50 + id: string; 50 51 51 52 external_urls: externalUrls; 52 53 ··· 71 72 obj.type === "track" && 72 73 "name" in obj && 73 74 typeof obj.name === "string" && 75 + "id" in obj && 76 + typeof obj.id === "string" && 74 77 "external_urls" in obj && 75 78 isExternalUrl(obj.external_urls) && 76 79 "album" in obj &&
+1
src/pages/now-playing-sse.ts
··· 15 15 ? { 16 16 type: "track" as const, 17 17 name: playing.name, 18 + id: playing.id, 18 19 external_urls: { 19 20 spotify: playing.external_urls.spotify, 20 21 },