Disconnect fix

This commit is contained in:
Adhiraj
2020-07-16 13:35:25 +05:30
parent a04a908b94
commit 5a39683c02

View File

@@ -65,8 +65,9 @@ export default class WAConnectionBase {
this.close()
if ((error === 'lost' || error === 'closed') && this.autoReconnect) {
await this.reconnectLoop ()
} else if (this.unexpectedDisconnectCallback) {
this.unexpectedDisconnectCallback (error)
}
if (this.unexpectedDisconnectCallback) this.unexpectedDisconnectCallback (error)
}
/** Set the callback for unexpected disconnects including take over events, log out events etc. */
setOnUnexpectedDisconnect(callback: (error: string) => void) {