mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-30 02:18:29 +00:00
28 lines
574 B
TypeScript
28 lines
574 B
TypeScript
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,
|
|
}
|