Skip to content

Feature: Adds OTP cooldown timer #6439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

gregfromstl
Copy link
Member

@gregfromstl gregfromstl commented Mar 7, 2025


PR-Codex overview

This PR introduces a countdown feature for email cooldown in the OTPLoginUI component. It prevents users from resending the code until the countdown reaches zero, enhancing user experience by visually indicating when they can resend the code.

Detailed summary

  • Added a new state variable countdown initialized to 0.
  • Set countdown to 60 seconds when an email is sent.
  • Implemented a useEffect hook to manage the countdown timer.
  • Updated the LinkButton to disable resending while the countdown is active and show the remaining time.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@gregfromstl gregfromstl requested review from a team as code owners March 7, 2025 23:04
Copy link

linear bot commented Mar 7, 2025

Copy link

changeset-bot bot commented Mar 7, 2025

🦋 Changeset detected

Latest commit: 350ffcd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
thirdweb Patch
@thirdweb-dev/wagmi-adapter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Mar 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2025 11:11pm
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2025 11:11pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2025 11:11pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2025 11:11pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2025 11:11pm

Copy link
Contributor

graphite-app bot commented Mar 7, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Mar 7, 2025
Copy link
Contributor

github-actions bot commented Mar 7, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 46.76 KB (0%) 936 ms (0%) 250 ms (+165.98% 🔺) 1.2 s
thirdweb (cjs) 127.15 KB (0%) 2.6 s (0%) 332 ms (+34.28% 🔺) 2.9 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 112 ms (0%) 134 ms (+1459.02% 🔺) 246 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 22 ms (+723.23% 🔺) 32 ms
thirdweb/react (minimal + tree-shaking) 19.34 KB (0%) 387 ms (0%) 77 ms (+379% 🔺) 464 ms

Copy link

codecov bot commented Mar 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 26 lines in your changes missing coverage. Please review.

Project coverage is 54.62%. Comparing base (1c135b0) to head (350ffcd).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...irdweb/src/react/web/wallets/shared/OTPLoginUI.tsx 0.00% 26 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6439      +/-   ##
==========================================
- Coverage   54.64%   54.62%   -0.03%     
==========================================
  Files         874      874              
  Lines       54708    54732      +24     
  Branches     3707     3708       +1     
==========================================
  Hits        29896    29896              
- Misses      24717    24741      +24     
  Partials       95       95              
Flag Coverage Δ
packages 54.62% <0.00%> (-0.03%) ⬇️
Files with missing lines Coverage Δ
...irdweb/src/react/web/wallets/shared/OTPLoginUI.tsx 6.00% <0.00%> (-0.56%) ⬇️
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gregfromstl gregfromstl added the merge-queue Adds the pull request to Graphite's merge queue. label Mar 7, 2025
Copy link
Member Author

gregfromstl commented Mar 7, 2025

Merge activity

  • Mar 7, 6:53 PM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 7, 6:56 PM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.

@gregfromstl gregfromstl merged commit 2ae778e into main Mar 7, 2025
32 of 33 checks passed
@gregfromstl gregfromstl deleted the greg/tool-3657-implement-timer-to-prevent-login-retry-cycle-issues branch March 7, 2025 23:55
@joaquim-verges joaquim-verges mentioned this pull request Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-queue Adds the pull request to Graphite's merge queue. packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants