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
parent 05f57d2f39
commit 794c9e16fc

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;