diff --git a/src/components/app/app.ts b/src/components/app/app.ts index 64955db..e604b93 100644 --- a/src/components/app/app.ts +++ b/src/components/app/app.ts @@ -155,7 +155,7 @@ export default class App extends Vue }); // Wait for assignments to be ready. - pWaitFor(() => this.courses.every(c => c.assignments != null)).then(() => + pWaitFor(() => this.courses.every(c => c.rawAssignments != null)).then(() => { // Filter courses this.filteredCourses = this.courses.filter(c => c.isGraded); diff --git a/src/logic/course.ts b/src/logic/course.ts index aeed266..c4e74cb 100644 --- a/src/logic/course.ts +++ b/src/logic/course.ts @@ -1,8 +1,9 @@ -import {Assignment} from '@/components/app/app'; +import App, {Assignment} from '@/components/app/app'; import JsonUtils from '@/utils/json-utils'; import Constants from '@/constants'; import {FormatUtils} from '@/utils/format-utils'; import {CourseUtils} from '@/utils/course-utils'; +import Navigation from '@/components/navigation/navigation'; export default class Course { @@ -11,7 +12,7 @@ export default class Course name: string; teacherName: string; status: string; - assignments: Assignment[]; + rawAssignments: Assignment[]; letterGrade?: string; numericGrade?: number; @@ -68,19 +69,19 @@ export default class Course { // Load assignments // Parse json and filter it - this.assignments = JsonUtils.filterAssignments(data); + this.rawAssignments = JsonUtils.filterAssignments(data); // Sort by date (Latest is at 0) - this.assignments.sort((a, b) => b.date.getTime() - a.date.getTime()); + this.rawAssignments.sort((a, b) => b.date.getTime() - a.date.getTime()); // Filter assignments into terms let termAssignments: Assignment[][] = [[], [], [], []]; let currentTerm = 0; // Loop through it by time order - for (let i = this.assignments.length - 1; i >= 0; i--) + for (let i = this.rawAssignments.length - 1; i >= 0; i--) { - let a = this.assignments[i]; + let a = this.rawAssignments[i]; // On to the next term if (currentTerm < 3 && a.date > Constants.TERMS[currentTerm + 1])