Added WS reconnect on error toast.

This commit is contained in:
Blaž Kristan 2022-02-17 12:51:37 +01:00
parent 3be4b69b44
commit 7f92607b85
2 changed files with 819 additions and 812 deletions

View File

@ -280,6 +280,12 @@ function showToast(text, error = false) {
}
function showErrorToast() {
if (ws && ws.readyState === WebSocket.OPEN) {
// if we received a timeout force WS reconnect
ws.close();
ws = null;
if (lastinfo.ws > -1) setTimeout(makeWS,500);
}
showToast('Connection to light failed!', true);
}
function clearErrorToast() {

File diff suppressed because it is too large Load Diff