fix: upload more than 100 files in directory (#317)

This commit is contained in:
plantatorbob 2023-12-11 13:28:11 +03:00 committed by GitHub
parent 8590f3e841
commit cd84dff87f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -732,8 +732,16 @@ async function addFileEntries(entries, dirs) {
new Uploader(file, dirs).upload();
});
} else if (entry.isDirectory) {
const dirReader = entry.createReader()
dirReader.readEntries(entries => addFileEntries(entries, [...dirs, entry.name]));
const dirReader = entry.createReader();
const successCallback = entries => {
if (entries.length > 0) {
addFileEntries(entries, [...dirs, entry.name]);
dirReader.readEntries(successCallback);
}
};
dirReader.readEntries(successCallback);
}
}
}