Personal Site

prettier formatted smthn m8 idk what to say

vielle.dev 0eaa9554 0e725cfe

verified
+14 -10
+14 -10
src/components/playing/NowPlaying.astro
··· 57 57 </div> 58 58 </section> 59 59 60 - {track instanceof SpotifyError && <script set:html={`console.error("Failed to load nowPlaying:", ${JSON.stringify(track)})`}></script>} 60 + { 61 + track instanceof SpotifyError && ( 62 + <script 63 + set:html={`console.error("Failed to load nowPlaying:", ${JSON.stringify(track)})`} 64 + /> 65 + ) 66 + } 61 67 62 68 <style> 63 69 @keyframes spin { ··· 184 190 </style> 185 191 186 192 <script> 187 - import { 188 - type nowPlaying, 189 - isNowPlaying, 190 - } from "./spotify/client"; 193 + import { type nowPlaying, isNowPlaying } from "./spotify/client"; 191 194 192 195 const nowPlayingEl = document.getElementById("now-playing"); 193 196 if (!nowPlayingEl) throw new Error("Could not find #now-playing"); 194 - const art = nowPlayingEl.querySelector(".art") 195 - if (!art || !(art instanceof HTMLImageElement)) throw new Error("Could not find #now-playing img.art"); 197 + const art = nowPlayingEl.querySelector(".art"); 198 + if (!art || !(art instanceof HTMLImageElement)) 199 + throw new Error("Could not find #now-playing img.art"); 196 200 197 201 const renderNowPlaying = (playing: Exclude<nowPlaying, null>) => { 198 - art.src = playing.album.images[0].url 202 + art.src = playing.album.images[0].url; 199 203 }; 200 204 201 205 const renderSilent = () => { 202 - art.src = "https://undefined/" 206 + art.src = "https://undefined/"; 203 207 }; 204 208 205 209 const events = new EventSource("/now-playing-sse"); ··· 214 218 return renderNowPlaying(playing); 215 219 216 220 // server sent strange/error response 217 - console.error("Unexpected value sent from server:", playing) 221 + console.error("Unexpected value sent from server:", playing); 218 222 // continue as normal as the previous value WAS ok 219 223 }); 220 224 </script>