diff --git a/src/logic/course.ts b/src/logic/course.ts index 7aff36e..b9c559f 100644 --- a/src/logic/course.ts +++ b/src/logic/course.ts @@ -184,8 +184,7 @@ export default class Course { return this.cache.get('GradingPeriods', () => { - let timeCode = Navigation.instance.getSelectedTerm(); - return (timeCode == -1 ? [0, 1, 2, 3] : [timeCode]).filter(term => + return (this.rawSelectedTerm == -1 ? [0, 1, 2, 3] : [this.rawSelectedTerm]).filter(term => this.termAssignments[term].filter(a => a.graded).length != 0); }) } @@ -344,4 +343,12 @@ export default class Course { return {hash: this.urlHash, title: this.name, identifier: 'course', info: {id: this.id}} } + + /** + * Selected term + */ + get rawSelectedTerm(): number + { + return Navigation.instance.getSelectedTerm() + } }