Added WS reconnect on error toast.

pull/2547/head
Blaž Kristan 2022-02-17 12:51:37 +01:00
rodzic 3be4b69b44
commit 7f92607b85
2 zmienionych plików z 819 dodań i 812 usunięć

Wyświetl plik

@ -280,6 +280,12 @@ function showToast(text, error = false) {
} }
function showErrorToast() { 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); showToast('Connection to light failed!', true);
} }
function clearErrorToast() { function clearErrorToast() {

Plik diff jest za duży Load Diff