anix: fetch recommended in discovery only if logged in

This commit is contained in:
Kentai Radiquum 2025-08-27 23:18:30 +05:00
parent bf24cd1063
commit 3d08603bc3
Signed by: Radiquum
GPG key ID: 858E8EE696525EED

View file

@ -9,7 +9,7 @@ import useSWR from "swr";
export const RecommendedCarousel = () => {
const token = useUserStore((state) => state.token);
const { data, isLoading, error } = useSWR(
`${ENDPOINTS.discover.recommendations}/-1?previous_page=-1${token ? `&token=${token}` : ""}`,
token ? `${ENDPOINTS.discover.recommendations}/-1?previous_page=-1&token=${token}` : null,
useSWRfetcher,
{
revalidateOnFocus: false,