1
0

Attempt WebSocket reconnect on disconnect or keep-alive death

Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
James Ketrenos 2022-02-28 20:34:37 -08:00
parent 69de42f644
commit 7439eaf21f

View File

@ -865,7 +865,14 @@ class Table extends React.Component {
} }
this.keepAlive = setTimeout(() => { this.keepAlive = setTimeout(() => {
console.error(`No server ping for 5 seconds!`); console.error(`No server ping for 5 seconds!`);
this.ws.close();
this.setState({ noNetwork: true }); this.setState({ noNetwork: true });
if (!this.websocketReconnect) {
this.websocketReconnect = setTimeout(() => {
delete this.websocketReconnect;
this.connectWebSocket();
}, 1000);
}
}, 5000); }, 5000);
} }