From f101d6a555c6d3453def332f2c230b37ae5c81b4 Mon Sep 17 00:00:00 2001 From: SayaAndy Date: Thu, 23 Oct 2025 19:32:11 +0700 Subject: fix: disable subscription form if user has no verified email fix: check properly if the email was already taken --- views/pages/user-page.html | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'views') diff --git a/views/pages/user-page.html b/views/pages/user-page.html index 13eaa0b..7d39825 100644 --- a/views/pages/user-page.html +++ b/views/pages/user-page.html @@ -105,7 +105,9 @@ htmx.on("htmx:afterSwap", (e) => { emailMessage = htmx.find("#email-message"); verificationMessage = htmx.find("#verification-message"); emailForm = htmx.find("#email-form"); + emailInput = htmx.find("#email-input"); emailVerificationForm = htmx.find("#email-verification-form"); + subsForm = htmx.find("#subs-form"); tryAgainTimeDiff = parseInt(emailMessage.dataset.strikedEndTime || "0") - new Date().getTime(); verificationWaitingTimeDiff = parseInt(emailMessage.dataset.codeExpiryTime || "0") - new Date().getTime(); @@ -129,6 +131,12 @@ htmx.on("htmx:afterSwap", (e) => { if ((verificationMessage.dataset.hideVerificationPanel || "false") == "true") { emailVerificationForm.classList.add("hidden"); } + + if (emailInput.dataset.validatedEmail != "") { + subsForm.classList.remove("disabled"); + } else { + subsForm.classList.add("disabled"); + } }); function checkIfValidated(elem) { -- cgit v1.3.1+13