Spaces:
Configuration error
Configuration error
Download frontend/src/hooks/query/use-vscode-url.ts from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 591 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/hooks/query/use-vscode-url.ts
- Command line
-
hf download hf://spaces/flyingdarkdev/README/frontend/src/hooks/query/use-vscode-url.ts
-
curl -L -o use-vscode-url.ts https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/hooks/query/use-vscode-url.ts
591 Bytes
| import { useQuery } from "@tanstack/react-query"; | |
| import OpenHands from "#/api/open-hands"; | |
| import { useConversation } from "#/context/conversation-context"; | |
| export const useVSCodeUrl = (config: { enabled: boolean }) => { | |
| const { conversationId } = useConversation(); | |
| const data = useQuery({ | |
| queryKey: ["vscode_url", conversationId], | |
| queryFn: () => { | |
| if (!conversationId) throw new Error("No conversation ID"); | |
| return OpenHands.getVSCodeUrl(conversationId); | |
| }, | |
| enabled: !!conversationId && config.enabled, | |
| refetchOnMount: true, | |
| }); | |
| return data; | |
| }; | |