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