[O] Optimize isAssignmentsReady()
This commit is contained in:
@@ -164,7 +164,7 @@ export default class App extends Vue
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Wait for assignments to be ready.
|
// Wait for assignments to be ready.
|
||||||
pWaitFor(() => this.isAssignmentsReady()).then(() =>
|
pWaitFor(() => this.courses.every(c => c.assignments != null)).then(() =>
|
||||||
{
|
{
|
||||||
// Filter courses
|
// Filter courses
|
||||||
this.filteredCourses = CourseUtils.getGradedCourses(this.courses);
|
this.filteredCourses = CourseUtils.getGradedCourses(this.courses);
|
||||||
@@ -174,21 +174,6 @@ export default class App extends Vue
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Are assignments ready or not
|
|
||||||
*
|
|
||||||
* @returns boolean Ready or not
|
|
||||||
*/
|
|
||||||
private isAssignmentsReady(): boolean
|
|
||||||
{
|
|
||||||
for (const course of this.courses)
|
|
||||||
{
|
|
||||||
if (course.assignments == null) return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the courses' grading algorithms. (Total-mean or percent-type)
|
* Check the courses' grading algorithms. (Total-mean or percent-type)
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user