From cc046010ff6e19fc28e98f5e88ac5525ffe117f4 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sat, 1 Aug 2020 15:49:27 -0400 Subject: [PATCH] [O] Make gradedCourses a getter instead of a field --- src/components/app/app.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/app/app.ts b/src/components/app/app.ts index 903dcf2..6f83533 100644 --- a/src/components/app/app.ts +++ b/src/components/app/app.ts @@ -58,6 +58,11 @@ export default class App extends Vue // Is the login panel shown showLogin: boolean = !this.demoMode + get gradedCourses() + { + return this.courses.filter(course => course.isGraded); + } + /** * This is called when the instance is created. */ @@ -131,14 +136,7 @@ export default class App extends Vue }); // Wait for assignments to be ready. - pWaitFor(() => this.courses.every(c => c.rawAssignments != null)).then(() => - { - // Filter courses - this.gradedCourses = this.courses.filter(c => c.isGraded); - - // Check grading algorithms - this.checkGradingAlgorithms(); - }); + pWaitFor(() => this.courses.every(c => c.rawAssignments != null)).then(this.checkGradingAlgorithms); } /**