mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Disconnect fix
This commit is contained in:
@@ -65,8 +65,9 @@ export default class WAConnectionBase {
|
|||||||
this.close()
|
this.close()
|
||||||
if ((error === 'lost' || error === 'closed') && this.autoReconnect) {
|
if ((error === 'lost' || error === 'closed') && this.autoReconnect) {
|
||||||
await this.reconnectLoop ()
|
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. */
|
/** Set the callback for unexpected disconnects including take over events, log out events etc. */
|
||||||
setOnUnexpectedDisconnect(callback: (error: string) => void) {
|
setOnUnexpectedDisconnect(callback: (error: string) => void) {
|
||||||
|
|||||||
Reference in New Issue
Block a user