mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-11-21 15:36:21 -05:00
auto reconnect websocket when it gets disconnected
This commit is contained in:
parent
6e83516e19
commit
a3cd39dd5c
1 changed files with 6 additions and 0 deletions
|
|
@ -140,6 +140,7 @@
|
|||
return {
|
||||
|
||||
isWebsocketConnected: false,
|
||||
autoReconnectWebsocket: true,
|
||||
|
||||
sendToDestinationHash: "bebfd1f0635a7f6129ee3b30c05328f3",
|
||||
|
||||
|
|
@ -166,6 +167,11 @@
|
|||
|
||||
this.ws.addEventListener('close', () => {
|
||||
this.isWebsocketConnected = false;
|
||||
if(this.autoReconnectWebsocket){
|
||||
setTimeout(() => {
|
||||
this.connectWebsocket();
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
// handle data from reticulum
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue