summaryrefslogtreecommitdiff
path: root/frontend/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/main.js')
-rw-r--r--frontend/main.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/frontend/main.js b/frontend/main.js
index 40a965b..e20a467 100644
--- a/frontend/main.js
+++ b/frontend/main.js
@@ -134,7 +134,12 @@ async function updateMachines() {
// --- current timers
async function startLoadTimers() {
- const timers = await fetchTimers();
+ const timersData = await fetchTimers();
+
+ if (timersData[0] != 200) {
+ console.error(timersData[0].toString() + " from backend: " + timersData[1]);
+ return;
+ }
const container = document.getElementById("timer-container")
@@ -206,7 +211,7 @@ async function fetchTimers() {
method: "POST",
credentials: "include",
});
- return [response.status, response.json()];
+ return [response.status, await response.json()];
}
const delay = (durationMs) => {