mirror of
https://github.com/block/buzz.git
synced 2026-10-30 05:51:46 +00:00
18 lines
494 B
TypeScript
18 lines
494 B
TypeScript
import { useQuery } from "@tanstack/react-query";
|
|
|
|
import { getGitIdentity } from "@/shared/api/projectGit";
|
|
|
|
/**
|
|
* The viewer's configured git identity (`git config user.name/user.email`),
|
|
* used to attribute their own commits to their Buzz profile.
|
|
*/
|
|
export function useGitIdentityQuery() {
|
|
return useQuery({
|
|
queryKey: ["git-identity"],
|
|
queryFn: getGitIdentity,
|
|
// Git config rarely changes while the app runs.
|
|
staleTime: Number.POSITIVE_INFINITY,
|
|
retry: 1,
|
|
});
|
|
}
|