mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-20 20:49:14 +00:00
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:
@@ -430,6 +430,15 @@ class Client extends EventEmitter {
|
|||||||
}, chatId);
|
}, chatId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Force reset of connection state for the client
|
||||||
|
*/
|
||||||
|
async resetState(){
|
||||||
|
await this.pupPage.evaluate(() => {
|
||||||
|
window.Store.AppState.phoneWatchdog.shiftTimer.forceRunNow();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Client;
|
module.exports = Client;
|
||||||
|
|||||||
Reference in New Issue
Block a user