diff --git a/frontend/index.js b/frontend/index.js index 29d4c47..f6f6014 100644 --- a/frontend/index.js +++ b/frontend/index.js @@ -91,19 +91,25 @@ async function populateScreen() { } } - for (let i = (history.length -1); i >= 0; i-=1) { + try { + for (let i = (history.length -1); i >= 0; i-=1) { + historyPage.innerHTML += ` +
+
+
+

User: ${history[i].user}

+

Task: ${history[i].task}

+

Time: ${history[i].time}

+

Points gained: ${history[i].pointsGained}

+
+
+
` + } + } catch (e) { historyPage.innerHTML += ` -
-
-
-

User: ${history[i].user}

-

Task: ${history[i].task}

-

Time: ${history[i].time}

-

Points gained: ${history[i].pointsGained}

-
-
-
` + Such empty` } + for (let i = 0; i < stats.length; i++) { // put user points in box statsPage.innerText += `${stats[i].name}: ${stats[i].points} \n`