hackafor-2 icon indicating copy to clipboard operation
hackafor-2 copied to clipboard

fix: init timer now starts correctly

Open Leviakc opened this issue 10 months ago • 1 comments

Changes Made 🎉

  • [ ] feat: added new feature to improve user experience
  • [x] fix: corrected a bug with login functionality
  • [x] refactor: improved code readability and organization
  • [ ] docs: updated README with new instructions
  • [ ] chore: updated dependencies and configuration files

Describe Changes

The countdown timer starts at 0 when the page is loaded. However, there's a delay because the setInterval function takes 1 second to apply. To ensure timely updates, I've created a function called updateCountdown. This function is invoked within a useLayoutEffect hook to take effect before the page renders. Additionally, I've created a separate function to avoid code repetition within both the useLayoutEffect and useEffect hooks."

Related Issue(s)

  • Issue Number

Visuals (Optional)

Before

init-time

After

init timer

Checklist ✅

  • [x] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.

Leviakc avatar Apr 19 '24 03:04 Leviakc

@Leviakc is attempting to deploy a commit to the aforina's projects Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Apr 19 '24 03:04 vercel[bot]

This bug had been around for quite a while, AMAZING! Thank you very much for the contribution!

afordigital avatar May 10 '24 23:05 afordigital