Update DropFile to handle object versioning

This commit is contained in:
2024-09-02 16:24:23 +02:00
parent b6edbb3eed
commit 3d49c959e0
42 changed files with 857 additions and 539 deletions

View File

@@ -132,7 +132,6 @@ console.log(PdfWorker); // incredible but this is needed
import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
import {
build_download_info_link,
download_and_decrypt_doc,
} from "../StoredObjectButton/helpers";
@@ -157,7 +156,6 @@ declare global {
const $toast = useToast();
const signature = window.signature;
const urlInfo = build_download_info_link(signature.storedObject.filename);
const mountPdf = async (url: string) => {
const loadingTask = pdfjsLib.getDocument(url);
@@ -189,11 +187,7 @@ const setPage = async (page: number) => {
async function downloadAndOpen(): Promise<Blob> {
let raw;
try {
raw = await download_and_decrypt_doc(
urlInfo,
signature.storedObject.keyInfos,
new Uint8Array(signature.storedObject.iv)
);
raw = await download_and_decrypt_doc(signature.storedObject, signature.storedObject.currentVersion);
} catch (e) {
console.error("error while downloading and decrypting document", e);
throw e;