fix(core): update
This commit is contained in:
		| @@ -7,4 +7,5 @@ export type TConnectionStatus = | |||||||
|   | 'connecting' |   | 'connecting' | ||||||
|   | 'connected' |   | 'connected' | ||||||
|   | 'disconnecting' |   | 'disconnecting' | ||||||
|   | 'disconnected'; |   | 'disconnected' | ||||||
|  |   | 'timedOut'; | ||||||
|   | |||||||
| @@ -118,6 +118,7 @@ export class SmartsocketClient { | |||||||
|     const timer = new plugins.smarttime.Timer(5000); |     const timer = new plugins.smarttime.Timer(5000); | ||||||
|     timer.start(); |     timer.start(); | ||||||
|     timer.completed.then(() => { |     timer.completed.then(() => { | ||||||
|  |       this.updateStatus('timedOut'); | ||||||
|       logger.log('warn', 'connection to server timed out.'); |       logger.log('warn', 'connection to server timed out.'); | ||||||
|       this.disconnect(true); |       this.disconnect(true); | ||||||
|     }); |     }); | ||||||
| @@ -189,7 +190,7 @@ export class SmartsocketClient { | |||||||
|   /** |   /** | ||||||
|    * disconnect from the server |    * disconnect from the server | ||||||
|    */ |    */ | ||||||
|   public async disconnect(useAutoconnectSetting = false) { |   public async disconnect(useAutoReconnectSetting = false) { | ||||||
|     if (this.disconnectRunning) { |     if (this.disconnectRunning) { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
| @@ -209,7 +210,7 @@ export class SmartsocketClient { | |||||||
|     logger.log('warn', `disconnected from server ${this.remoteShortId}`); |     logger.log('warn', `disconnected from server ${this.remoteShortId}`); | ||||||
|     this.remoteShortId = null; |     this.remoteShortId = null; | ||||||
|  |  | ||||||
|     if (this.autoReconnect && useAutoconnectSetting && this.eventStatus !== 'connecting') { |     if (this.autoReconnect && useAutoReconnectSetting && this.eventStatus !== 'connecting') { | ||||||
|       this.updateStatus('connecting'); |       this.updateStatus('connecting'); | ||||||
|       await this.tryDebouncedReconnect(); |       await this.tryDebouncedReconnect(); | ||||||
|       this.disconnectRunning = false; |       this.disconnectRunning = false; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user