[O] Optimize isGradingReady() with Array.every()
This commit is contained in:
@@ -224,7 +224,7 @@ export default class App extends Vue
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Wait for done
|
// Wait for done
|
||||||
pWaitFor(() => this.isGradingReady()).then(() =>
|
pWaitFor(() => this.filteredCourses.every(c => c.grading != undefined)).then(() =>
|
||||||
{
|
{
|
||||||
// When the assignments are ready
|
// When the assignments are ready
|
||||||
// TODO: Display loading
|
// 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
|
* This is called when a navigation tab is clicked
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user