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,13 +1,13 @@
import { useMutation, useQuery } from "@tanstack/react-query";
import * as api from "../service/ProfileService";
import { getToken } from "@/lib/api/func";
import { hasAuthToken } from "@/lib/api/func";
export const useGetProfile = () => {
return useQuery({
queryKey: ["profile"],
queryFn: api.getProfile,
retry: false,
enabled: !!getToken(),
enabled: hasAuthToken(),
});
};