Skip to content

Conversation

@relyks
Copy link
Contributor

@relyks relyks commented Jan 29, 2026

Description

Once the NewsletterSignUpForm is populated with the submitter's information and the submission completes successfully, the submitter should be prevented from submitting again. Doing so will prevent duplicate submissions from being entered into Salesforce and ActiveCampaign

Code Changes

  • State variable added based on whether the user's submission has successfully gone through
  • disabled property added to each of the text input fields
  • Conditionally render the submission icon based on that same state variable

@relyks relyks self-assigned this Jan 29, 2026
@relyks relyks requested a review from yitzhakc January 29, 2026 08:10
@mergify
Copy link

mergify bot commented Jan 29, 2026

🧪 CI Insights

Here's what we observed from your CI run for 2297662.

🟢 All jobs passed!

But CI Insights is watching 👀

if (showNameInputs === true) { // submit
if (firstName.length > 0 && lastName.length > 0) {
setSubscribeMessage("Subscribing...");
subscribe(firstName, lastName, email, educatorCheck, additionalNewsletterMailingLists).then(res => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is the call to the API, do you perhaps want to disable the button prior to the call, as soon as the user has Clicked, and keep it disabled until the request returns - either as a 200 success, or a failure? This way, the button will be clickable until the request returns..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that would be better to handle that scenario too. I'll implement it. I forgot to consider that. Thanks

…ontend during the submission process while the API call is being made
…submit button when the form is not submitting or already subscribed
@relyks relyks force-pushed the feature/sc-41273/prevent-duplicate-submissions-in-the branch from 91c13d5 to 2297662 Compare February 2, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants