Skip to content

Commit 9bf09b7

Browse files
committed
refresh files after upload
1 parent f281666 commit 9bf09b7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/file-upload.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import React, { useState } from "react"
33
import Autocomplete from "@/components/autocomplete"
44
import { Button } from "./ui/button"
5-
import { Separator } from "./ui/separator"
65
import { useDownloadableFiles } from "@/hooks/useDownloadableFiles"
76
import { toast } from "./ui/use-toast"
87
import { Dropzone } from "./dropzone"
@@ -11,7 +10,7 @@ import { Card, CardContent, CardFooter, CardHeader, CardTitle } from "./ui/card"
1110
const FileUpload = () => {
1211
const [path, setPath] = useState<any>(null)
1312
const [files, setFiles] = useState([])
14-
const { downloadableFiles } = useDownloadableFiles()
13+
const { downloadableFiles, fetchFiles } = useDownloadableFiles()
1514

1615
const handleSave = () => {
1716
files.forEach((file: any) => {
@@ -29,6 +28,8 @@ const FileUpload = () => {
2928
variant: "success",
3029
})
3130
setPath(null)
31+
setFiles([])
32+
fetchFiles()
3233
}
3334

3435
return (

0 commit comments

Comments
 (0)