clear reconnect timer on new connection

This commit is contained in:
or-else
2021-04-28 17:05:00 -07:00
parent 7adc06332e
commit 273e34de2c
5 changed files with 11 additions and 3 deletions
+3
View File
@@ -5040,6 +5040,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
window.removeEventListener('resize', this.handleResize);
window.removeEventListener('hashchange', this.handleHashRoute);
document.removeEventListener('visibilitychange', this.handleVisibilityEvent);
clearInterval(this.reconnectCountdown);
}
static tnSetup(serverAddress, transport, locale, persistentCache, onSetupCompleted) {
@@ -5240,6 +5241,8 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
}
handleConnected() {
clearInterval(this.reconnectCountdown);
this.handleError();
const params = this.tinode.getServerInfo();
this.setState({
serverVersion: params.ver + ' ' + (params.build ? params.build : 'none')