1
0
Fork 0
mirror of https://github.com/24eme/signaturepdf synced 2026-03-14 13:55:44 +01:00

organization: load PDF from cache

This commit is contained in:
Gabriel Poma 2025-07-15 17:33:49 +02:00
commit 7561fae205
2 changed files with 4 additions and 0 deletions

View file

@ -57,6 +57,7 @@ async function loadFileFromCache(cacheUrl, pageUrl) {
type: 'application/pdf'
}));
document.getElementById('input_pdf_upload').files = dataTransfer.files;
document.getElementById('input_pdf_upload').dispatchEvent(new Event("change"));
}
async function storeFileInCache() {

View file

@ -924,6 +924,9 @@ document.addEventListener('DOMContentLoaded', function () {
let hashUrl = window.location.hash.replace(/^\#/, '');
pageUpload();
uploadFromUrl(hashUrl);
} else if (window.location.hash && canUseCache()) {
pageUpload()
loadFileFromCache('/pdf/'+window.location.hash.replace(/^\#/, ''));
} else {
pageUpload();
}