Skip to content

Commit

Permalink
fix dropdown warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ddvk committed Nov 22, 2024
1 parent 97ce715 commit 8dc4bcd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ui/src/pages/Documents/Upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,16 @@ async function uploadFilesInBatches(files, uploadFolder, batchSize = 100) {
}
}

export default function StyledDropzone(props) {
export default function StyledDropzone({filesUploaded, uploadFolder}) {
const [uploading, setUploading] = useState(false);
const uploadFolder = props.uploadFolder;

var onDrop = async (acceptedFiles) => {
try {
setUploading(true);
// TODO: add loading and error handling
await uploadFilesInBatches(acceptedFiles, uploadFolder);
// await delay(100)
props.filesUploaded();
filesUploaded();
} catch (e) {
toast.error("upload error" + e.toString());
} finally {
Expand All @@ -47,7 +46,11 @@ export default function StyledDropzone(props) {
isDragAccept,
isDragReject,
} = useDropzone({
accept: "application/pdf, application/zip, application/epub+zip",
accept: {
"application/pdf":[],
"application/zip":[".zip", ".rmdoc"],
"application/epub+zip":[],
},
onDropAccepted: onDrop,
maxSize: 1 * 1024 * 1024 * 1024, // 1GB
});
Expand Down

0 comments on commit 8dc4bcd

Please sign in to comment.