Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/pages/home/toolbar/PackageDownload.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "~/utils/zip-stream.js"
import streamSaver from "streamsaver"
import { getLinkByDirAndObj, useRouter, useT } from "~/hooks"
import { fsList, pathBase, pathJoin } from "~/utils"
import { fsList, joinBase, pathBase, pathJoin } from "~/utils"
import { password, selectedObjs as _selectedObjs } from "~/store"
import { createSignal, For, Show } from "solid-js"
import {
Expand All @@ -14,7 +14,7 @@ import {
} from "@hope-ui/solid"
import { Obj } from "~/types"

streamSaver.mitm = "/streamer/mitm.html"
streamSaver.mitm = joinBase("streamer", "mitm.html")
const trimSlash = (str: string) => {
return str.replace(/^\/+|\/+$/g, "")
}
Expand Down Expand Up @@ -115,6 +115,11 @@ const PackageDownload = (props: { onClose: () => void }) => {
const url = it.value.url
// console.log(name, url);
return fetch(url).then((res) => {
if (!res.ok) {
throw new Error(
`Failed to fetch ${name}: ${res.status} ${res.statusText}`,
)
}
setFetchings((prev) => [...prev, name])
ctrl.enqueue({
name,
Expand Down