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
+5
View File
@@ -285,6 +285,7 @@ class TinodeWeb extends React.Component {
window.removeEventListener('resize', this.handleResize);
window.removeEventListener('hashchange', this.handleHashRoute);
document.removeEventListener('visibilitychange', this.handleVisibilityEvent);
clearInterval(this.reconnectCountdown);
}
// Setup transport (usually websocket) and server address. This will terminate connection with the server.
@@ -453,6 +454,10 @@ class TinodeWeb extends React.Component {
// Connection succeeded.
handleConnected() {
// Just to be sure.
clearInterval(this.reconnectCountdown);
this.handleError();
const params = this.tinode.getServerInfo();
this.setState({
serverVersion: params.ver + ' ' + (params.build ? params.build : 'none')
+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')
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long