()
| 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(); |
no test coverage detected