[O] Optimize isGradingReady() with Array.every()

This commit is contained in:
Hykilpikonna
2019-10-13 19:09:55 -04:00
parent 992be72d8d
commit 797d962e40
+1 -19
View File
@@ -224,7 +224,7 @@ export default class App extends Vue
}
// Wait for done
pWaitFor(() => this.isGradingReady()).then(() =>
pWaitFor(() => this.filteredCourses.every(c => c.grading != undefined)).then(() =>
{
// When the assignments are ready
// TODO: Display loading
@@ -232,24 +232,6 @@ export default class App extends Vue
})
}
/**
* Are grading algorithms ready or not.
*
* @returns boolean Ready or not
*/
private isGradingReady(): boolean
{
for (const course of this.filteredCourses)
{
if (course.grading == undefined)
{
return false;
}
}
return true;
}
/**
* This is called when a navigation tab is clicked
*