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

View File

@@ -259,6 +259,10 @@ client.on('change_battery', (batteryInfo) => {
console.log(`Battery: ${battery}% - Charging? ${plugged}`);
});
client.on('change_state', state => {
console.log('CHANGE STATE', state );
});
client.on('disconnected', (reason) => {
console.log('Client was logged out', reason);
});