From ae5608faa43616a4eb1e9da9e70bfe9b916baf6e Mon Sep 17 00:00:00 2001 From: samuel Pelletier-Evraire Date: Thu, 28 Nov 2024 13:08:46 -0500 Subject: [PATCH] - fix npm error --- src/components/Dropzone.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Dropzone.tsx b/src/components/Dropzone.tsx index bbc9d0d8..3f52c94f 100644 --- a/src/components/Dropzone.tsx +++ b/src/components/Dropzone.tsx @@ -57,16 +57,18 @@ const Dropzone: React.FC = ({ } } - 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]); }