diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Geshem.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Geshem.js b/src/Geshem.js index 6128f8d..d37770b 100644 --- a/src/Geshem.js +++ b/src/Geshem.js @@ -27,19 +27,19 @@ function Geshem(props) { const [slider, setSlider] = useState(playback ? 143 : 9); useEffect(() => { - const fetchImages = async () => + const fetchImages = async () => fetch(`${IMAGES_BASE_URL}/imgs.json`) .then(res => res.json()) .then(imgs => imgs['280']) .then(setImages) ) - + const buildPlayback = async () => setImages( Array(24*6) .fill('') .map((_,i) => `imgs/${playback}/${`${parseInt(i/6, 10)%24}`.padStart(2, '0')}${i%6}0/280.png`) ) - + return playback ? (buildPlayback(), () => void 0) : (fetchImages(), ((timer) => () => clearTimer(timer))(setInterval(fetchImages, 60 * 1000)) |
