From c40329806e2b2f732424856b2f5b9272705a7f00 Mon Sep 17 00:00:00 2001 From: Ryan Freeman Date: Sat, 17 Aug 2024 23:15:10 +0100 Subject: [PATCH] test cache workaround --- components/ui/SpotifyPlayer.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/ui/SpotifyPlayer.tsx b/components/ui/SpotifyPlayer.tsx index 63b69f5..aed0ac8 100644 --- a/components/ui/SpotifyPlayer.tsx +++ b/components/ui/SpotifyPlayer.tsx @@ -110,7 +110,8 @@ type PlayerStateResponse = { } function usePlayerState(path: string) { - const {data, error, isLoading} = useSWR(`/api/spotify/${path}`, fetcher) as PlayerStateResponse + const timestamp = Date.parse(new Date().toString()) + const {data, error, isLoading} = useSWR(`/api/spotify/${path}?ts=${timestamp}`, fetcher) as PlayerStateResponse return { song: data,