web/DownloadButton: show a message about ongoing antibot check
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
import { createDialog } from "$lib/dialogs";
|
||||
import { downloadFile } from "$lib/download";
|
||||
|
||||
import { cachedInfo } from "$lib/api/server-info";
|
||||
import { turnstileLoaded } from "$lib/state/turnstile";
|
||||
|
||||
import type { DialogInfo } from "$lib/types/dialog";
|
||||
|
||||
export let url: string;
|
||||
@@ -63,6 +66,15 @@
|
||||
export const download = async (link: string) => {
|
||||
changeDownloadButton("think");
|
||||
|
||||
if ($cachedInfo?.info?.cobalt?.turnstileSitekey && !$turnstileLoaded) {
|
||||
changeDownloadButton("error");
|
||||
|
||||
return createDialog({
|
||||
...defaultErrorPopup,
|
||||
bodyText: $t("error.captcha_ongoing"),
|
||||
});
|
||||
}
|
||||
|
||||
const response = await API.request(link);
|
||||
|
||||
if (!response) {
|
||||
|
||||
Reference in New Issue
Block a user