me + unseen-count dont request if do not login
This commit is contained in:
@@ -132,7 +132,7 @@ function FoodPage({}: Props) {
|
||||
<div className="relative w-full lg:h-full min-h-0 not-lg:bg-container rounded-2xl overflow-hidden lg:rounded-r-none lg:order-1">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img
|
||||
className="lg:object-contain h-auto object-cover bg-[#F2F2F9] w-full"
|
||||
className="lg:object-cover lg:h-full object-cover bg-[#F2F2F9] w-full"
|
||||
src={foodImage}
|
||||
alt={foodName}
|
||||
onError={(event) => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import * as api from "../service/MenuService";
|
||||
import { useParams } from "next/navigation";
|
||||
import { hasAuthToken } from "@/lib/api/func";
|
||||
|
||||
export const useGetFoods = () => {
|
||||
const { name } = useParams<{ name: string }>();
|
||||
@@ -26,5 +27,6 @@ export const useGetNotificationsCount = () => {
|
||||
return useQuery({
|
||||
queryKey: ["notifications-count"],
|
||||
queryFn: api.getNotificationsCount,
|
||||
enabled: hasAuthToken(),
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user