From f00307d62fcd6af54cf97fda8b8677f66af4594e Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Thu, 12 Jun 2025 18:18:57 +0200 Subject: [PATCH] [mirotalksfu] - #200 improvements --- public/js/RoomClient.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js index 86192c89..d02bae10 100644 --- a/public/js/RoomClient.js +++ b/public/js/RoomClient.js @@ -1067,8 +1067,8 @@ class RoomClient { this.socket.io.on('reconnect', this.handleSocketReconnect); this.socket.io.on('reconnect_failed', this.handleSocketReconnectFailed); this.socket.on('connect', this.handleSocketConnect); - this.socket.on('disconnect', this.handleSocketDisconnect); this.socket.on('connect_error', this.handleSocketConnectionError); + this.socket.on('disconnect', this.handleSocketDisconnect); this.socket.on('consumerClosed', this.handleConsumerClosed); this.socket.on('setVideoOff', this.handleSetVideoOff); this.socket.on('removeMe', this.handleRemoveMe); @@ -1383,12 +1383,7 @@ class RoomClient { const delay = Math.min(this.reconnectInterval * attempt, this.maxReconnectInterval); - if (this.reconnectAlert) { - this.reconnectAlert.update({ - title: 'Reconnecting', - text: `Reconnection attempt in ${delay / 1000} seconds...`, - }); - } + this.updateReconnectAlert(delay); } handleDisconnect(reason) { @@ -1425,6 +1420,15 @@ class RoomClient { } } + updateReconnectAlert(delay) { + if (this.reconnectAlert) { + this.reconnectAlert.update({ + title: 'Reconnecting', + text: `Reconnection attempt in ${delay / 1000} seconds...`, + }); + } + } + closeReconnectAlert() { if (this.reconnectAlert) { this.reconnectAlert.close();