summaryrefslogtreecommitdiffhomepage
path: root/html
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-08-06 13:52:33 +0200
committerRoland Reichwein <mail@reichwein.it>2023-08-06 13:52:33 +0200
commit78bffdea4d792cee421f5382129b192df654c0f3 (patch)
tree0426d895ce9ee7b9dbd4af07e8bf65d26e9cea36 /html
parente9b1b6899e588cb563953eab07bc6baf2eb7bcaa (diff)
Add note on empty pdf
Diffstat (limited to 'html')
-rw-r--r--html/whiteboard.js12
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)