This commit is contained in:
2025-11-12 17:02:27 +01:00
parent d2e27c12a2
commit b812d748ea
44 changed files with 221 additions and 356 deletions
@@ -10,8 +10,7 @@ const mapFilesToEntries = (filesInput) => {
return files
.filter(Boolean)
.map((file) => {
const relativePath =
typeof file.webkitRelativePath === 'string' ? file.webkitRelativePath : '';
const relativePath = file?.webkitRelativePath ?? '';
const segments = relativePath
? relativePath
.split('/')
@@ -213,10 +212,7 @@ const useDocumentUploads = ({
const fileFromItem = typeof item.getAsFile === 'function' ? item.getAsFile() : null;
if (fileFromItem) {
const relativePath =
typeof fileFromItem.webkitRelativePath === 'string'
? fileFromItem.webkitRelativePath
: '';
const relativePath = fileFromItem?.webkitRelativePath ?? '';
const segments = relativePath
? relativePath
.split('/')
@@ -246,8 +242,7 @@ const useDocumentUploads = ({
Array.from(dataTransfer.files || []).forEach((file) => {
if (!file) return;
const relativePath =
typeof file.webkitRelativePath === 'string' ? file.webkitRelativePath : '';
const relativePath = file?.webkitRelativePath ?? '';
const segments = relativePath
? relativePath
.split('/')