hackafor-2
hackafor-2 copied to clipboard
fix: init timer now starts correctly
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
After
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 is attempting to deploy a commit to the aforina's projects Team on Vercel.
A member of the Team first needs to authorize it.
This bug had been around for quite a while, AMAZING! Thank you very much for the contribution!