mirror of
https://github.com/s00500/ESPUI.git
synced 2025-07-04 06:10:18 +00:00
Added a check for an invalid json format to prevent the UI from crashing. Requests a new reload when the issue is encountered.
This commit is contained in:
13
data/js/controls.js
vendored
13
data/js/controls.js
vendored
@ -230,13 +230,24 @@ function start() {
|
||||
};
|
||||
|
||||
websock.onerror = function (evt) {
|
||||
console.log("websock Error");
|
||||
console.log(evt);
|
||||
conStatusError();
|
||||
};
|
||||
|
||||
var handleEvent = function (evt) {
|
||||
console.log(evt);
|
||||
var data = JSON.parse(evt.data);
|
||||
try
|
||||
{
|
||||
var data = JSON.parse(evt.data);
|
||||
}
|
||||
catch (Event)
|
||||
{
|
||||
console.error(Event);
|
||||
// start the update over again
|
||||
websock.send("uiok:" + 0);
|
||||
return;
|
||||
}
|
||||
var e = document.body;
|
||||
var center = "";
|
||||
|
||||
|
Reference in New Issue
Block a user