feat: force state update (#77)

Whatsapp web will not update state until some action, this will force update client state.
First will set state to TIMEOUT, then to current state
This commit is contained in:
Jan Vlach 2020-02-28 22:00:24 +01:00 • committed by GitHub
commit 794c9e16fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -430,6 +430,15 @@ class Client extends EventEmitter {
}, chatId);
}
/**
* Force reset of connection state for the client
*/
async resetState(){
await this.pupPage.evaluate(() => {
window.Store.AppState.phoneWatchdog.shiftTimer.forceRunNow();
});
}
}
module.exports = Client;