summaryrefslogtreecommitdiffci
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
-rw-r--r--internal/mailer/mailer.go7
-rw-r--r--internal/router/api-v1-email-verify.go2
-rw-r--r--locale/localization.en.yaml1
-rw-r--r--locale/localization.go1
-rw-r--r--locale/localization.ru.yaml1
-rw-r--r--views/pages/user-page.html8
6 files changed, 2 insertions, 18 deletions
diff --git a/internal/mailer/mailer.go b/internal/mailer/mailer.go
index ba2202e..cd5eda8 100644
--- a/internal/mailer/mailer.go
+++ b/internal/mailer/mailer.go
@@ -145,8 +145,7 @@ func (m *Mailer) MailIsTaken(email string) (bool, error) {
defer tx.Commit()
defer rows.Close()
- isTaken := rows.Next()
- return isTaken, nil
+ return rows.Next(), nil
}
func (m *Mailer) GetInfo(userId string) (email string, lang string, err error) {
@@ -356,7 +355,3 @@ func (m *Mailer) Subscribe(userId string, subscriptionType SubscriptionType, tag
return nil
}
-
-func SendNewPost() {
-
-}
diff --git a/internal/router/api-v1-email-verify.go b/internal/router/api-v1-email-verify.go
index 7fbfdec..fad174b 100644
--- a/internal/router/api-v1-email-verify.go
+++ b/internal/router/api-v1-email-verify.go
@@ -45,7 +45,7 @@ func Api_V1_Email_Verify(l map[string]*locale.LocaleConfig) func(c *fiber.Ctx) e
slog.Error("verification code is invalid", slog.String("verification_code", verificationCode), slog.String("error", err.Error()))
return api_v1_email_sendStatusHtml(c, "verification-message", l, "Failed", fiber.ErrUnprocessableEntity.Code, lang, l[lang].UserProfile.VerificationFailed, map[string]string{})
}
- return api_v1_email_sendStatusHtml(c, "verification-message", l, "OK", fiber.StatusOK, lang, l[lang].UserProfile.VerificationSuccess+"\n\n"+l[lang].UserProfile.RefreshPage, map[string]string{
+ return api_v1_email_sendStatusHtml(c, "verification-message", l, "OK", fiber.StatusOK, lang, l[lang].UserProfile.VerificationSuccess, map[string]string{
"hide-verification-panel": "true",
})
}
diff --git a/locale/localization.en.yaml b/locale/localization.en.yaml
index ce334d9..8816f2e 100644
--- a/locale/localization.en.yaml
+++ b/locale/localization.en.yaml
@@ -62,4 +62,3 @@ UserProfile:
SubscribeInvalidType: 'Invalid subscription type.'
FailedToSubscribe: 'Failed to subscribe by new settings, please ask administrator for a more detailed cause.'
SubscribedSuccessfully: 'Successfully subscribed you by new settings!'
- RefreshPage: 'Please refresh the profile page on the device, where you requested the code.'
diff --git a/locale/localization.go b/locale/localization.go
index 1028c9e..cd83aa1 100644
--- a/locale/localization.go
+++ b/locale/localization.go
@@ -96,7 +96,6 @@ type UserProfileConfig struct {
SubscribeInvalidType string `yaml:"SubscribeInvalidType" json:"SubscribeInvalidType"`
FailedToSubscribe string `yaml:"FailedToSubscribe" json:"FailedToSubscribe"`
SubscribedSuccessfully string `yaml:"SubscribedSuccessfully" json:"SubscribedSuccessfully"`
- RefreshPage string `yaml:"RefreshPage" json:"RefreshPage"`
}
func LoadConfig(path string, config *LocaleConfig) error {
diff --git a/locale/localization.ru.yaml b/locale/localization.ru.yaml
index 8894e22..8a0ec5e 100644
--- a/locale/localization.ru.yaml
+++ b/locale/localization.ru.yaml
@@ -62,4 +62,3 @@ UserProfile:
SubscribeInvalidType: 'Неизвестный тип подписки.'
FailedToSubscribe: 'Неудачная попытка записать новую подписку, более подробно спрашивайте у администратора.'
SubscribedSuccessfully: 'Вы успешно подписались по новым настройкам!'
- RefreshPage: 'Пожалуйста, обновите страницу с профилем на устройстве, откуда запрашивали код.'
diff --git a/views/pages/user-page.html b/views/pages/user-page.html
index 7d39825..13eaa0b 100644
--- a/views/pages/user-page.html
+++ b/views/pages/user-page.html
@@ -105,9 +105,7 @@ 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();
@@ -131,12 +129,6 @@ 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) {