mirror of
https://github.com/wukko/cobalt.git
synced 2025-06-12 05:07:41 +02:00
web/turnstile: refresh turnstile if it expires in background
also renamed `turnstileLoaded` to `turnstileSolved` for more clarity
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
import dialogs from "$lib/state/dialogs";
|
||||
import { link } from "$lib/state/omnibox";
|
||||
import { updateSetting } from "$lib/state/settings";
|
||||
import { turnstileLoaded } from "$lib/state/turnstile";
|
||||
import { turnstileSolved } from "$lib/state/turnstile";
|
||||
|
||||
import type { Optional } from "$lib/types/generic";
|
||||
import type { DownloadModeOption } from "$lib/types/settings";
|
||||
@ -39,7 +39,8 @@
|
||||
|
||||
let isDisabled = false;
|
||||
let isLoading = false;
|
||||
let isBotCheckOngoing = false;
|
||||
$: isBotCheckOngoing =
|
||||
!!$cachedInfo?.info?.cobalt?.turnstileSitekey && !$turnstileSolved;
|
||||
|
||||
const validLink = (url: string) => {
|
||||
try {
|
||||
@ -61,16 +62,6 @@
|
||||
goto("/", { replaceState: true });
|
||||
}
|
||||
|
||||
$: if ($cachedInfo?.info?.cobalt?.turnstileSitekey) {
|
||||
if ($turnstileLoaded) {
|
||||
isBotCheckOngoing = false;
|
||||
} else {
|
||||
isBotCheckOngoing = true;
|
||||
}
|
||||
} else {
|
||||
isBotCheckOngoing = false;
|
||||
}
|
||||
|
||||
const pasteClipboard = () => {
|
||||
if ($dialogs.length > 0 || isDisabled || isLoading) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user