diff options
author | Roland Reichwein <mail@reichwein.it> | 2023-08-06 13:52:33 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2023-08-06 13:52:33 +0200 |
commit | 78bffdea4d792cee421f5382129b192df654c0f3 (patch) | |
tree | 0426d895ce9ee7b9dbd4af07e8bf65d26e9cea36 /html | |
parent | e9b1b6899e588cb563953eab07bc6baf2eb7bcaa (diff) |
Add note on empty pdf
Diffstat (limited to 'html')
-rw-r--r-- | html/whiteboard.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/html/whiteboard.js b/html/whiteboard.js index 50b0058..07e3804 100644 --- a/html/whiteboard.js +++ b/html/whiteboard.js @@ -96,10 +96,14 @@ function on_version(version) function on_pdf(pdf) { - var a = document.getElementById("download-a"); - a.href = "data:application/pdf;base64," + pdf; - a.download = get_id() + ".pdf" - a.click(); + if (pdf == "") { + alert("Note: Empty PDF, not saving."); + } else { + var a = document.getElementById("download-a"); + a.href = "data:application/pdf;base64," + pdf; + a.download = get_id() + ".pdf" + a.click(); + } } function on_modify_ack(rev) |