fix: emit disconnected event on page navigation

This also addresses an issue due to a change in behavior from WhatsApp Web when the session is logged out from the device.
This commit is contained in:
Pedro Lopez
2021-04-20 20:02:22 -04:00
parent f1e2f32988
commit 6cece4a006
3 changed files with 14 additions and 3 deletions

4
index.d.ts vendored
View File

@@ -149,8 +149,8 @@ declare namespace WAWebJS {
/** Emitted when the client has been disconnected */
on(event: 'disconnected', listener: (
/** state that caused the disconnect */
reason: WAState
/** reason that caused the disconnect */
reason: WAState | "NAVIGATED"
) => void): this
/** Emitted when a user joins the chat via invite link or is added by an admin */