Compare commits

..

3 Commits

Author SHA1 Message Date
Pedro Lopez
3c55fbf2ca 0.3.2 2020-01-17 22:06:19 -04:00
Pedro Lopez
6b1b51eacd Increase successful connection timeout 2020-01-17 22:06:04 -04:00
Pedro Lopez
2dc53e0820 [FIX] Connection success detection selector changed
close #31
2020-01-17 22:05:05 -04:00
3 changed files with 4 additions and 4 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "whatsapp-web.js",
"version": "0.3.1",
"version": "0.3.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "whatsapp-web.js",
"version": "0.3.1",
"version": "0.3.2",
"description": "Library for interacting with the WhatsApp Web API ",
"main": "./index.js",
"scripts": {

View File

@@ -46,12 +46,12 @@ class Client extends EventEmitter {
await page.goto(WhatsWebURL);
const KEEP_PHONE_CONNECTED_IMG_SELECTOR = '._1wSzK';
const KEEP_PHONE_CONNECTED_IMG_SELECTOR = '.HGVhc';
if (this.options.session) {
// Check if session restore was successfull
try {
await page.waitForSelector(KEEP_PHONE_CONNECTED_IMG_SELECTOR, { timeout: 5000 });
await page.waitForSelector(KEEP_PHONE_CONNECTED_IMG_SELECTOR, { timeout: 15000 });
} catch (err) {
if (err.name === 'TimeoutError') {
this.emit(Events.AUTHENTICATION_FAILURE, 'Unable to log in. Are the session details valid?');