Skip to content
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

update session details with latest course information before switchin… #3083

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

C-likethis123
Copy link

@C-likethis123 C-likethis123 commented Jan 30, 2025

…g courses

Description

Fixes the bug where switching courses redirects the user to the 'game' page, even when games are not enabled for the course.

The reason for this bug is because the loader function at src/pages/academy/academyRoutes checks for the enableGame flag in the Redux store before deciding whether to redirect, but the enableGame flag value belongs to the previous course and not the course it's about to switch to. The solution adopted in this MR is to update the latest viewed course to the course that the user is about to navigate to, before actually navigating to that course.

Screen.Recording.2025-01-31.at.12.30.06.AM.mov

Closes #3040.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Code quality improvements

How to test

  1. Course configuration: create two courses - one with games enabled and one without games enabled.
  2. Switch to the other course using the 'My courses' dropdown - it should redirect to the games page if the course has games enabled, and to the missions page otherwise.

Checklist

  • I have tested this code
  • I have updated the documentation

@coveralls
Copy link

Pull Request Test Coverage Report for Build 13056491962

Details

  • 6 of 7 (85.71%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 31.214%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/commons/dropdown/DropdownCourses.tsx 6 7 85.71%
Files with Coverage Reduction New Missed Lines %
src/commons/dropdown/DropdownCourses.tsx 1 61.11%
Totals Coverage Status
Change from base Build 12903997600: 0.02%
Covered Lines: 4847
Relevant Lines: 14651

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switching to course as an admin bring to game page, even when game is not enabled
2 participants