Spaces:
Configuration error
Configuration error
Download frontend/src/hooks/query/use-app-installations.ts from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 665 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/hooks/query/use-app-installations.ts
- Command line
-
hf download hf://spaces/flyingdarkdev/README/frontend/src/hooks/query/use-app-installations.ts
-
curl -L -o use-app-installations.ts https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/hooks/query/use-app-installations.ts
665 Bytes
| import { useQuery } from "@tanstack/react-query"; | |
| import { useConfig } from "./use-config"; | |
| import OpenHands from "#/api/open-hands"; | |
| import { useAuth } from "#/context/auth-context"; | |
| export const useAppInstallations = () => { | |
| const { data: config } = useConfig(); | |
| const { githubTokenIsSet } = useAuth(); | |
| return useQuery({ | |
| queryKey: ["installations", githubTokenIsSet, config?.GITHUB_CLIENT_ID], | |
| queryFn: OpenHands.getGitHubUserInstallationIds, | |
| enabled: | |
| githubTokenIsSet && | |
| !!config?.GITHUB_CLIENT_ID && | |
| config?.APP_MODE === "saas", | |
| staleTime: 1000 * 60 * 5, // 5 minutes | |
| gcTime: 1000 * 60 * 15, // 15 minutes | |
| }); | |
| }; | |