fix: await promise when setting user agent (#1113)

Some of my devices were bugging out because the setUserAgent didn't had an await, after this everything was working fine (try loading the wwebjs in a broken microSd ahhaha).

We need some testing but on my limited testing everything is working

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
tuyuribr 2022-02-05 16:42:25 -03:00 • committed by GitHub
commit 6878598a5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,7 +76,7 @@ class Client extends EventEmitter {
page = (await browser.pages())[0];
}
page.setUserAgent(this.options.userAgent);
await page.setUserAgent(this.options.userAgent);
this.pupBrowser = browser;
this.pupPage = page;