me + unseen-count dont request if do not login

This commit is contained in:
hamid zarghami
2026-06-06 10:56:59 +03:30
parent 22231fe800
commit d13792219b
4 changed files with 10 additions and 3 deletions
@@ -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(),
});
};