From da4ae7f9ccbab33c66726ac52fb8b87dd33eeb3b Mon Sep 17 00:00:00 2001 From: zyl Date: Tue, 25 Jun 2024 16:38:35 -0700 Subject: [PATCH] make pets once per page load --- site/root/js/pet-me.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/site/root/js/pet-me.js b/site/root/js/pet-me.js index 1011ddd..850b244 100644 --- a/site/root/js/pet-me.js +++ b/site/root/js/pet-me.js @@ -1,8 +1,6 @@ (function () { "use strict"; - const DEBOUNCE_TIMER = 1500; - const url = document.body.classList.contains("debug") ? "http://127.0.0.1:8787/api/pet" : "https://cf.zyllian.workers.dev/api/pet"; @@ -18,7 +16,7 @@ petButton.addEventListener("click", async () => { petButton.disabled = true; - setTimeout(() => (petButton.disabled = false), DEBOUNCE_TIMER); + petButton.innerText = "thanks! <3"; const r = await (await fetch(url, { method: "post" })).json(); if (r.count) { count.innerText = r.count;