Skip to content

Commit bfe3f67

Browse files
committed
Fix course page when switching to a different language
- Include language-configurations.language.leaderboard in course route load so the right sidebar can show the leaderboard for the selected language without triggering an unloaded-relationship error. - Do not clear activeRepositoryOverride after saving a language selection so the UI and leaderboard stay on the newly saved repo instead of reverting to the stale model.activeRepository.
1 parent 83cacdb commit bfe3f67

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

app/controllers/course.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export default class CourseController extends Controller {
133133

134134
this.repo = this.activeRepository.id;
135135
this.track = undefined;
136-
this.activeRepositoryOverride = null;
136+
// Keep activeRepositoryOverride so we keep showing this repo (model never refreshes)
137137

138138
return true;
139139
}

app/routes/course.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default class CourseRoute extends BaseRoute {
9898
const includedCourseResources = [
9999
'extensions',
100100
'stages.solutions.language',
101-
'language-configurations.language',
101+
'language-configurations.language.leaderboard',
102102
'stages.screencasts',
103103
'stages.screencasts.language',
104104
'stages.screencasts.user',

app/routes/course/stage.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ export default class CourseStageRoute extends BaseRoute {
1919
super(...args);
2020

2121
this.router.on('routeDidChange', (transition: Transition) => {
22-
if (
23-
transition?.from?.name === 'course.introduction' &&
24-
transition?.to?.name === 'course.introduction'
25-
) {
22+
if (transition?.from?.name === 'course.introduction' && transition?.to?.name === 'course.introduction') {
2623
return;
2724
}
2825

0 commit comments

Comments
 (0)