Compare commits

..

No commits in common. "4559f16d86b97a074e9c68c9d92de7cc8aa91d2a" and "70e525357cc06857755f53c0b064b752b95a05fc" have entirely different histories.

2 changed files with 14 additions and 8 deletions

View File

@ -536,11 +536,7 @@ export const SignPage = () => {
setIsLoading(true)
const arrayBuffer = await decrypt(selectedFile)
if (!arrayBuffer) {
setIsLoading(false)
toast.error('Error decrypting file')
return
}
if (!arrayBuffer) return
handleDecryptedArrayBuffer(arrayBuffer)
}
@ -775,9 +771,14 @@ export const SignPage = () => {
2
)
const zip = await getZipWithFiles(meta, files)
const zip = new JSZip()
zip.file('meta.json', stringifiedMeta)
for (const [fileName, file] of Object.entries(files)) {
zip.file(`files/${fileName}`, await file.arrayBuffer())
}
const arrayBuffer = await zip
.generateAsync({
type: 'arraybuffer',
@ -806,11 +807,16 @@ export const SignPage = () => {
const handleEncryptedExport = async () => {
if (Object.entries(files).length === 0 || !meta) return
const zip = new JSZip()
const stringifiedMeta = JSON.stringify(meta, null, 2)
const zip = await getZipWithFiles(meta, files)
zip.file('meta.json', stringifiedMeta)
for (const [fileName, file] of Object.entries(files)) {
zip.file(`files/${fileName}`, await file.arrayBuffer())
}
const arrayBuffer = await zip
.generateAsync({
type: 'arraybuffer',

View File

@ -20,7 +20,7 @@ export const getZipWithFiles = async (
for (const [fileName, file] of Object.entries(files)) {
// Handle PDF Files, add marks
if (file.isPdf && fileName in marksByFileNamePage) {
if (file.isPdf) {
const blob = await addMarks(file, marksByFileNamePage[fileName])
zip.file(`marked/${fileName}`, blob)
}