diff options
-rw-r--r-- | views/partials/canvas.html | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/views/partials/canvas.html b/views/partials/canvas.html index a336844..d51efc1 100644 --- a/views/partials/canvas.html +++ b/views/partials/canvas.html @@ -95,12 +95,17 @@ "Content-type": "application/json; charset=UTF-8" } }) - .then((response) => response.json()) - .then((json) => { - if (json.status == "ok") { - location.reload(); - } - }); + .then((response) => { + if (response.status === 429) { + alert("Rate limited! Only 5 messages every 10 minutes, sorry for the inconvenience"); + } + return response.json(); + }) + .then((json) => { + if (json.status == "ok") { + location.reload(); + } + }); } const sendbtn = document.getElementById('sendbtn'); sendbtn.addEventListener("click", sendPic); |