From 188d3e8af1eab6c17ba4a1e1b87c778771d79bb8 Mon Sep 17 00:00:00 2001 From: Leo Date: Sun, 15 Sep 2024 10:50:41 +0200 Subject: [PATCH] wait longer for listmonk to wake up in newsletter signup action --- app/components/NewsletterSignup/index.module.css | 5 ++++- app/components/NewsletterSignup/index.tsx | 2 +- app/routes/newsletter-signup.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/components/NewsletterSignup/index.module.css b/app/components/NewsletterSignup/index.module.css index 2929b8c..d376e98 100644 --- a/app/components/NewsletterSignup/index.module.css +++ b/app/components/NewsletterSignup/index.module.css @@ -54,7 +54,6 @@ flex-direction: column; justify-content: center; align-items: center; - margin: 0; background-color: lightseagreen; } .container > form.loading { @@ -130,3 +129,7 @@ background-color: grey; cursor: not-allowed; } + +.success { + margin-top: 0.6em; +} diff --git a/app/components/NewsletterSignup/index.tsx b/app/components/NewsletterSignup/index.tsx index befc5d7..ffd1d22 100644 --- a/app/components/NewsletterSignup/index.tsx +++ b/app/components/NewsletterSignup/index.tsx @@ -81,7 +81,7 @@ const NewsletterSignup = () => { aria-label="sign up for our newsletter" disabled={captchaState !== "verified"} > - sign me up + {fetcher.state === "idle" ? "sign me up" : "signing you up..."} diff --git a/app/routes/newsletter-signup.ts b/app/routes/newsletter-signup.ts index 50c5e5f..93072d4 100644 --- a/app/routes/newsletter-signup.ts +++ b/app/routes/newsletter-signup.ts @@ -38,7 +38,7 @@ export const action: ActionFunction = async ({ request }) => { await fetch(`${process.env.LISTMONK_API}`, { method: "head", }); - await new Promise((resolve) => setTimeout(resolve, 500)); + await new Promise((resolve) => setTimeout(resolve, 1000)); let res = await fetch(`${process.env.LISTMONK_API}/public/subscription`, { method: "post",