This commit is contained in:
2025-11-14 02:35:17 +01:00
parent 6f4ff68062
commit a3c5494bf7
53 changed files with 269 additions and 340 deletions
@@ -322,7 +322,7 @@ const useDocumentUploads = ({
items.map(async (item, index) => {
if (item.kind !== 'file') return;
const fileFromItem = typeof item.getAsFile === 'function' ? item.getAsFile() : null;
const fileFromItem = item.getAsFile?.() ?? null;
if (fileFromItem) {
const relativePath = (fileFromItem as File & { webkitRelativePath?: string })?.webkitRelativePath ?? '';
const segments = relativePath
@@ -334,9 +334,9 @@ const useDocumentUploads = ({
pushFile(fileFromItem, segments);
}
if (typeof item.webkitGetAsEntry === 'function') {
if ((item as ExtendedDataTransferItem).webkitGetAsEntry) {
try {
const entry = item.webkitGetAsEntry();
const entry = (item as ExtendedDataTransferItem).webkitGetAsEntry?.();
if (entry) {
await walkEntry(entry, []);
return;