Potential fixes for 2 code quality findings#115
Conversation
…lot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…lot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Code Review
This pull request introduces logout state handling and input validation for the division remainder exercise. Specifically, it resets user progress and updates the sidebar when a user logs out, and adds checks to ensure inputs are valid numbers. The review feedback suggests a more comprehensive state reset upon logout, including resetting the practice count and returning the user to the introduction page to maintain a consistent UI state.
| } else { | ||
| currentUser = null; | ||
| stepsCompleted = { | ||
| step_0: false, | ||
| step_1: false, | ||
| step_2: false, | ||
| step_3: false, | ||
| step_4: false, | ||
| step_5: false | ||
| }; | ||
| updateSidebar(); | ||
| } |
There was a problem hiding this comment.
When the user logs out, the application resets currentUser and stepsCompleted, but it does not reset the current lesson progress (practiceCount) or the UI view (currentStep). This can leave the user on a restricted practice page in an unauthenticated state. Calling showPage(0) will reset the view to the introduction and internally trigger updateSidebar(), ensuring a consistent state.
| } else { | |
| currentUser = null; | |
| stepsCompleted = { | |
| step_0: false, | |
| step_1: false, | |
| step_2: false, | |
| step_3: false, | |
| step_4: false, | |
| step_5: false | |
| }; | |
| updateSidebar(); | |
| } | |
| } else { | |
| currentUser = null; | |
| stepsCompleted = { | |
| step_0: false, | |
| step_1: false, | |
| step_2: false, | |
| step_3: false, | |
| step_4: false, | |
| step_5: false | |
| }; | |
| practiceCount = 0; | |
| showPage(0); | |
| } |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
This PR applies 2/4 suggestions from code quality AI findings. 2 suggestions were skipped to avoid creating conflicts.