update count immediately

This commit is contained in:
zyl 2024-06-25 16:44:28 -07:00
parent c03df4e661
commit f5f19b5b56
No known key found for this signature in database

View file

@ -17,6 +17,7 @@
petButton.addEventListener("click", async () => {
petButton.disabled = true;
petButton.outerHTML = "| thanks! <3";
count.innerText = Number.parseInt(count.innerText) + 1;
const r = await (await fetch(url, { method: "post" })).json();
if (r.count) {
count.innerText = r.count;