From ec0e79e779e012ed66b5690cd5629745bcf8f3cc Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Sat, 29 Nov 2025 23:56:41 +0700 Subject: notifiaction panel, implemented some status codes --- frontend/main.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'frontend/main.js') 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) => { -- cgit v1.2.3