Skip to content

Commit 5f72ca8

Browse files
committed
feat: refresh cache after upload (close AlistGo/alist#5258)
1 parent 5bb3c71 commit 5f72ca8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/pages/home/uploads/Upload.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
Box,
1414
} from "@hope-ui/solid"
1515
import { createSignal, For, Show } from "solid-js"
16-
import { useRouter, useT } from "~/hooks"
16+
import { usePath, useRouter, useT } from "~/hooks"
1717
import { getMainColor } from "~/store"
1818
import {
1919
RiDocumentFolderUploadFill,
@@ -72,6 +72,7 @@ const UploadFile = (props: UploadFileProps) => {
7272
const Upload = () => {
7373
const t = useT()
7474
const { pathname } = useRouter()
75+
const { refresh } = usePath()
7576
const [drag, setDrag] = createSignal(false)
7677
const [uploading, setUploading] = createSignal(false)
7778
const [asTask, setAsTask] = createSignal(false)
@@ -97,6 +98,7 @@ const Upload = () => {
9798
for await (const ms of asyncPool(3, files, handleFile)) {
9899
console.log(ms)
99100
}
101+
refresh(undefined, true)
100102
}
101103
const setUpload = (path: string, key: keyof UploadFileProps, value: any) => {
102104
setUploadFiles("uploads", (upload) => upload.path === path, key, value)

0 commit comments

Comments
 (0)