diff --git a/src/app/_components/subscribe-section.tsx b/src/app/_components/subscribe-section.tsx index 6e82f78..e851779 100644 --- a/src/app/_components/subscribe-section.tsx +++ b/src/app/_components/subscribe-section.tsx @@ -34,9 +34,18 @@ export function SubscribeSection(props: { variant: "aqua" | "teal" | "purple" }) "Content-Type": "application/json", }, }); - setResponseMsg(await response.text()); + const responseMsg = await response.text(); + const userAlreadySubscribed = responseMsg + .toLowerCase() + .includes("already a list member"); - if (response.ok) { + if (userAlreadySubscribed) { + setResponseMsg("Already subscribed"); + } else { + setResponseMsg(responseMsg); + } + + if (response.ok || userAlreadySubscribed) { setStatus("success"); } else { setStatus("error");