Skip to content

fix: prevent multiple submissions in waitlist form - #62

Merged
kasuncfdo merged 5 commits into
mainfrom
kasun/fix-waitlist-form
Apr 3, 2026
Merged

kasuncfdo merged 5 commits into
mainfrom
kasun/fix-waitlist-form

Conversation

@kasuncfdo

Copy link
Copy Markdown
Contributor

No description provided.

@kasuncfdo kasuncfdo self-assigned this Apr 3, 2026
@kasuncfdo kasuncfdo added the enhancement New feature or request label Apr 3, 2026
@vercel

vercel Bot commented Apr 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web3ceylon-web-fe Ready Ready Preview, Comment Apr 3, 2026 1:11am

Request Review

@coderabbitai

coderabbitai Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • rabbit:auto-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c1351553-4255-4bc8-a912-ff45067cbf87

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kasun/fix-waitlist-form

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Prevent multiple submissions in waitlist form

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Prevents multiple form submissions by checking submission state
• Adds isSubmitting() method to form ref interface
• Guards form submission in both button click and form submit handlers
• Removes unused onSubmitAnimating callback from form ref
Diagram
flowchart LR
  A["User clicks button"] --> B["Check isSubmitting state"]
  B --> C{Is form submitting?}
  C -->|Yes| D["Return early"]
  C -->|No| E["Proceed with submission"]
  E --> F["Set isSubmitting to true"]
  F --> G["Submit form"]
Loading

Grey Divider

File Changes

1. src/components/button/FixedWaitlistButton.tsx 🐞 Bug fix +1/-0

Add submission state check to button click handler

• Added guard clause to check if form is already submitting before triggering submit
• Prevents multiple rapid submissions by returning early if formRef.current.isSubmitting() is true

src/components/button/FixedWaitlistButton.tsx


2. src/components/form/WaitlistForm.tsx 🐞 Bug fix +3/-1

Add submission state tracking and guard logic

• Updated WaitlistFormRef interface to expose isSubmitting() method instead of
 onSubmitAnimating callback
• Implemented isSubmitting() method in imperative handle to return current submission state
• Added guard clause in handleSubmit to prevent submission if form is already submitting

src/components/form/WaitlistForm.tsx


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

kasuncfdo and others added 2 commits April 3, 2026 06:39
…t functionality

- Changed API response method from `toAIStreamResponse` to `toTextStreamResponse` in `route.ts`.
- Updated import path for `useCompletion` from `ai/react` to `@ai-sdk/react` in `page.tsx`.
- Enhanced site loader behavior by adding a timer to hide the SSR overlay in `site-loader-provider.tsx`.
- Replaced `Dialog.Overlay` with `DialogBackdrop` in `Modal.tsx` for better backdrop handling.
- Temporarily commented out Ella's speaker section in `speakers.tsx` with a descriptive comment.
- Simplified initial state in `useWindowSize.ts` to avoid SSR issues.
- Refactored Cloudinary import to use destructuring in `cloudinary.ts`.
- Updated TypeScript configuration to use `react-jsx` for JSX transformation and added new type paths in `tsconfig.json`.
@kasuncfdo
kasuncfdo merged commit 995ff63 into main Apr 3, 2026
6 checks passed
@kasuncfdo
kasuncfdo deleted the kasun/fix-waitlist-form branch April 3, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants