Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <div className="mt-6 flex flex-col-reverse gap-3 sm:flex-row sm:justify-end"> | ||
| <button | ||
| type="button" | ||
| onClick={onClose} | ||
| className="w-full rounded-full border border-gray-300 px-5 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-50 sm:w-auto" | ||
| > | ||
| تعديل المعلومات | ||
| </button> | ||
| <button | ||
| type="button" | ||
| onClick={onConfirm} | ||
| disabled={!agreementChecked} | ||
| className="w-full rounded-full bg-indigo-600 px-6 py-2 text-sm font-semibold text-white transition enabled:hover:bg-indigo-500 enabled:focus:outline-none enabled:focus:ring-2 enabled:focus:ring-indigo-400 disabled:cursor-not-allowed disabled:bg-indigo-300 sm:w-auto" |
There was a problem hiding this comment.
Prevent repeated submissions while API call is pending
The confirm button only disables when the agreement checkbox is unchecked. handleDialogConfirm sets isSubmitting and awaits submitRegistration, but because this state is not passed to the dialog and the global loading overlay sits behind the dialog (z-40 vs z-50), the button remains clickable while the network request is in flight. A user can double-click or repeatedly click during a slow response and trigger multiple registration requests and confirmation emails. Passing the submitting state to the dialog and disabling the button (or otherwise guarding against re-entry) would avoid duplicate submissions.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_b_6902601172888328bb9ba940ff6580f5