Skip to content

Commit

Permalink
- fix npm error
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelPelletierEvraire committed Nov 28, 2024
1 parent 487c3a9 commit ae5608f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/Dropzone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,18 @@ const Dropzone: React.FC<DropzoneProps> = ({
}
}

async function traverseFileTree(item: any) {
async function traverseFileTree(item: FileSystemEntry) {
if (item.isFile) {
item.file((file: File) => {
const fileEntry = item as FileSystemFileEntry;
fileEntry.file((file: File) => {
if (allowedImagesExtensions.some((ext) => file.name.endsWith(ext))) {
processFile(file);
}
});
} else if (item.isDirectory) {
const dirReader = item.createReader();
dirReader.readEntries((entries: any) => {
const dirEntry = item as FileSystemDirectoryEntry;
const dirReader = dirEntry.createReader();
dirReader.readEntries((entries: FileSystemEntry[]) => {
for (let i = 0; i < entries.length; i++) {
traverseFileTree(entries[i]);
}
Expand Down

0 comments on commit ae5608f

Please sign in to comment.