mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-11 19:05:41 +00:00
Update SpotifyPlayer.tsx
This commit is contained in:
parent
69ab05c208
commit
460d9b21d1
@ -110,13 +110,7 @@ type PlayerStateResponse = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function usePlayerState(path: string) {
|
function usePlayerState(path: string) {
|
||||||
const {data, error, isLoading} = useSWR(`/api/spotify/${path}`, fetcher, {
|
const {data, error, isLoading} = useSWR(`/api/spotify/${path}`, fetcher) as PlayerStateResponse
|
||||||
refreshInterval: 3600,
|
|
||||||
revalidateIfStale: true,
|
|
||||||
revalidateOnMount: true,
|
|
||||||
revalidateOnFocus: true,
|
|
||||||
revalidateOnReconnect: true
|
|
||||||
}) as PlayerStateResponse
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
song: data,
|
song: data,
|
||||||
|
Loading…
Reference in New Issue
Block a user