This is my personal website
1
fork

Configure Feed

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

fix progressbar

+8 -1
+8 -1
islands/NowPlaying.tsx
··· 25 25 } | null 26 26 >(null); 27 27 const songRef = useRef(song); 28 + const isPlayingRef = useRef(isPlaying); 28 29 29 30 const fetchNowPlaying = async () => { 30 31 const response = await fetch( ··· 101 102 } 102 103 103 104 progressInterval.current = setInterval(() => { 105 + if (!isPlayingRef.current) { 106 + setProgress(0); 107 + return; 108 + } 109 + 104 110 if ( 105 111 songRef.current && songRef.current.progress && songRef.current.duration 106 112 ) { ··· 157 163 158 164 useEffect(() => { 159 165 songRef.current = song; 160 - }, [song]); 166 + isPlayingRef.current = isPlaying; 167 + }, [song, isPlaying]); 161 168 162 169 return ( 163 170 <div>