me + unseen-count dont request if do not login
This commit is contained in:
@@ -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