diff --git a/templates/index.html b/templates/index.html index 03ff30b..bd12029 100644 --- a/templates/index.html +++ b/templates/index.html @@ -80,8 +80,9 @@ fetch('/unsecure/esp/toggle-machine', { method: 'POST' }) .then(res => res.json()) .then(data => { - console.log(data); - if (data.command === 'machineToggle') { + //console.log(data); + const inner = JSON.parse(data.status); + if (inner.command === 'machineToggle') { document.getElementById("machine-status").innerText = "PENDING"; } else { document.getElementById("machine-status").innerText = "SOME_ERR";