From 6d96bb5047c06da8ca50811d0f2c0304a44ef68e Mon Sep 17 00:00:00 2001 From: arch0Xd <71967828+arch0Xd@users.noreply.github.com> Date: Sun, 14 Aug 2022 18:53:09 +0200 Subject: [PATCH] megint --- pages/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/index.tsx b/pages/index.tsx index 579d3a6..08ff646 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -14,7 +14,7 @@ import { FaSpotify } from 'react-icons/fa' const fetcher = (url: RequestInfo) => fetch(url).then(r => r.json()) export default function() { - const { data: spotify } = useSWR('/api/spotify', fetcher) + const { data: spotify } = useSWR('/api/spotify', fetcher, { refreshInterval: 1000 }) if(!spotify) return @@ -40,7 +40,7 @@ export default function() { { spotify.song ? - { spotify.song.artist + ' - ' + spotify.song.title } + { spotify.song.title || 'nothing' } : nothing