This commit is contained in:
Gaspard Jankowiak 2026-06-06 21:34:58 +02:00 committed by gapato
commit 5b2cffbd00

View file

@ -55,7 +55,7 @@ async function downloadApplicantFilesWithProgress(applicantDetails, token, onPro
throw `Failed to download file ${afile.file_id} for applicant ${applicantDetails.id}` throw `Failed to download file ${afile.file_id} for applicant ${applicantDetails.id}`
} }
afile.bytes = await response.bytes() afile.bytes = new Uint8Array(await response.arrayBuffer())
completedDownloads += 1 completedDownloads += 1
downloadedBytes += afile.bytes.length downloadedBytes += afile.bytes.length
onProgress({ downloaded: completedDownloads, total: files.length, bytes: downloadedBytes }) onProgress({ downloaded: completedDownloads, total: files.length, bytes: downloadedBytes })
@ -291,7 +291,7 @@ async function createZipBlob(archiveEntries) {
console.log(archiveEntries) console.log(archiveEntries)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
fflate.zip(archiveEntries, { level: 0, consume: true }, (error, data) => { fflate.zip(archiveEntries, { mem: 9, level: 0, consume: true }, (error, data) => {
if (error != null) { if (error != null) {
reject(error) reject(error)
return return
@ -527,6 +527,7 @@ function rip(event) {
archiveEntries["fflate.min.js"] = viewerFflateSource archiveEntries["fflate.min.js"] = viewerFflateSource
console.log("Generating zip archive...") console.log("Generating zip archive...")
createZipBlob(archiveEntries) createZipBlob(archiveEntries)
.then((zipBlob) => { .then((zipBlob) => {
console.log("Zip archive is ready.") console.log("Zip archive is ready.")