MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / fetchValidScript

Function fetchValidScript

src/pages/install/hooks.tsx:597–610  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

595
596 const loadURLAsync = async (url: string) => {
597 const fetchValidScript = async () => {
598 const result = await fetchScriptBody(url, {
599 onProgress: (info: { receivedLength: number }) => {
600 setFetchingState((prev) => ({
601 ...prev,
602 loadingStatus: t("downloading_status_text", { bytes: formatBytes(info.receivedLength) }),
603 }));
604 },
605 });
606 if (result.code && result.metadata) {
607 return { result, url } as const;
608 }
609 throw new Error(t("install_page_load_failed"));
610 };
611
612 try {
613 const { result, url } = await fetchValidScript();

Callers 1

loadURLAsyncFunction · 0.85

Calls 2

fetchScriptBodyFunction · 0.90
formatBytesFunction · 0.90

Tested by

no test coverage detected