diff options
Diffstat (limited to 'dist/js/teachers.js')
-rw-r--r-- | dist/js/teachers.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dist/js/teachers.js b/dist/js/teachers.js index da69e96..da0a62d 100644 --- a/dist/js/teachers.js +++ b/dist/js/teachers.js @@ -35,8 +35,8 @@ async function loadTeachers(force_refresh = false) { await gsecInstance.login(username, password); gsecInstance.fetchTeachers().then( (value) => { teachers = value; - localforage.setItem("teachers", value).then(() => { - displayData(); + localforage.setItem("teachers", value).then((saved_teachers) => { + displayData(saved_teachers); setLoading(false); }); setLoading(false); @@ -49,13 +49,13 @@ async function loadTeachers(force_refresh = false) { setLoading(false); } } else { - displayData(); + displayData(teachers); setLoading(false); } } // Function for displaying data -function displayData() { +function displayData(teachers) { for(const teacher of Object.keys(teachers)) { // Create row let row = document.createElement("tr"); |