Spaces:
Paused
Paused
Download web/src/lib/api/turnstile.ts from Lordgrim7/cobalt-api: direct link, hf CLI and curl.
- Browser
- Download file 574 Bytes
-
https://huggingface.co/spaces/Lordgrim7/cobalt-api/resolve/main/web/src/lib/api/turnstile.ts
- Command line
-
hf download hf://spaces/Lordgrim7/cobalt-api/web/src/lib/api/turnstile.ts
-
curl -L -o turnstile.ts https://huggingface.co/spaces/Lordgrim7/cobalt-api/resolve/main/web/src/lib/api/turnstile.ts
574 Bytes
| import { turnstileSolved } from "$lib/state/turnstile"; | |
| const getResponse = () => { | |
| const turnstileElement = document.getElementById("turnstile-widget"); | |
| if (turnstileElement) { | |
| return window?.turnstile?.getResponse(turnstileElement); | |
| } | |
| return null; | |
| } | |
| const reset = () => { | |
| const turnstileElement = document.getElementById("turnstile-widget"); | |
| if (turnstileElement) { | |
| turnstileSolved.set(false); | |
| return window?.turnstile?.reset(turnstileElement); | |
| } | |
| return null; | |
| } | |
| export default { | |
| getResponse, | |
| reset, | |
| } | |