From ac10fc0ccac7d56f6205e501246f7c78c31c3539 Mon Sep 17 00:00:00 2001 From: AmPlace <81105770+AmPlace@users.noreply.github.com> Date: Wed, 12 Aug 2026 16:17:33 +0800 Subject: [PATCH] fix(offline): show native tools for destination storage - Request offline download tools with the current save path. - Refresh the list when opening the dialog so native 115 and Thunder tools are visible. Co-authored-by: Codex <267193182+codex@users.noreply.github.com> --- src/pages/home/toolbar/OfflineDownloadEnhanced.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/pages/home/toolbar/OfflineDownloadEnhanced.tsx b/src/pages/home/toolbar/OfflineDownloadEnhanced.tsx index 888d62736..c33336254 100644 --- a/src/pages/home/toolbar/OfflineDownloadEnhanced.tsx +++ b/src/pages/home/toolbar/OfflineDownloadEnhanced.tsx @@ -101,8 +101,9 @@ export const OfflineDownloadEnhanced = () => { // 下载工具列表 const [tools, setTools] = createSignal([] as string[]) - const [toolsLoading, reqTool] = useFetch((): PResp => { - return r.get("/public/offline_download_tools") + const [toolsLoading, reqTool] = useFetch((path: string): PResp => { + const query = path ? `?path=${encodeURIComponent(path)}` : "" + return r.get(`/public/offline_download_tools${query}`) }) const [tool, setTool] = createSignal("") const [deletePolicy, setDeletePolicy] = createSignal( @@ -241,19 +242,22 @@ export const OfflineDownloadEnhanced = () => { } }) - onMount(async () => { - const resp = await reqTool() + const loadTools = async (path: string) => { + const resp = await reqTool(path) handleResp(resp, (data) => { setTools(data) setTool(data[0]) }) - }) + } + + onMount(() => loadTools(pathname())) // 监听 bus 事件 const handler = (name: string) => { if (name === "offline_download") { const currentPath = pathname() setSavePath(currentPath) + void loadTools(currentPath) onOpen() } }