[O] Optimize assignmentsReady

This commit is contained in:
Hykilpikonna
2019-12-21 12:39:48 -05:00
parent e26decd77d
commit 956119be2a
+9 -7
View File
@@ -28,9 +28,6 @@ export default class App extends Vue
// The currently selected tab // The currently selected tab
selectedTab: string = 'overall'; selectedTab: string = 'overall';
// Are the course assignments loaded from the server.
assignmentsReady: boolean = false;
// Token // Token
user: LoginUser = null as any; user: LoginUser = null as any;
@@ -188,16 +185,21 @@ export default class App extends Vue
} }
// Wait for done // Wait for done
pWaitFor(() => this.filteredCourses.every(c => c.termGrading.every(g => g != null))).then(() => pWaitFor(() => this.assignmentsReady).then(() =>
{ {
// When the assignments are ready
this.assignmentsReady = true;
// Remove loading // Remove loading
this.logLoading(''); this.logLoading('');
}) })
} }
/**
* Returns true when assignments are done loading
*/
get assignmentsReady(): boolean
{
return this.gradedCourses.every(c => c.termGrading.every(g => g != null));
}
/** /**
* Log a message to loading screen * Log a message to loading screen
* *