From c237e55a29dc18cc3d9f974c80472c8fce9bb759 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 28 Aug 2022 21:50:20 +0200 Subject: [PATCH] number keyboard --- internal/api/userpage/static/webapp.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/api/userpage/static/webapp.html b/internal/api/userpage/static/webapp.html index 44a5cf8..6714d71 100644 --- a/internal/api/userpage/static/webapp.html +++ b/internal/api/userpage/static/webapp.html @@ -236,7 +236,7 @@
- +
@@ -317,10 +317,10 @@ }) .then(r => { console.log(r); - var invoiceAmount = document.getElementById("invoiceAmount").value; - if (invoiceAmount == "") { - invoiceAmount = 1000; - console.warn("overwriting invoiceAmount with " + invoiceAmount); + var invoiceAmount = Number(document.getElementById("invoiceAmount").value); + if (!Number.isInteger(invoiceAmount) || invoiceAmount < 1) { + document.getElementById("requestInvoice").innerHTML = "Error" + return true; } console.log("requesting invoice with amount " + invoiceAmount); fetch(r.callback + '?amount='+ invoiceAmount * 1000).then(data => {