fix: minor fix for timeouts

pull/148/head
Travis Fischer 2022-12-15 21:33:24 -06:00
rodzic b4f1ff799b
commit 9aeb17e7f7
2 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -315,7 +315,7 @@ This package is ESM-only. It supports:
## Credits
- Huge thanks to [@waylaidwanderer](https://github.com/waylaidwanderer), [@wong2](https://github.com/wong2), [@simon300000](https://github.com/simon300000), [@RomanHotsiy](https://github.com/RomanHotsiy), [@ElijahPepe](https://github.com/ElijahPepe), and all the other contributors 💪
- Huge thanks to [@abacaj](https://github.com/abacaj), [@waylaidwanderer](https://github.com/waylaidwanderer), [@wong2](https://github.com/wong2), [@simon300000](https://github.com/simon300000), [@RomanHotsiy](https://github.com/RomanHotsiy), [@ElijahPepe](https://github.com/ElijahPepe), and all the other contributors 💪
- The original browser version was inspired by this [Go module](https://github.com/danielgross/whatsapp-gpt) by [Daniel Gross](https://github.com/danielgross)
- [OpenAI](https://openai.com) for creating [ChatGPT](https://openai.com/blog/chatgpt/) 🔥

Wyświetl plik

@ -88,11 +88,11 @@ export class ChatGPTAPIBrowser {
if (url !== chatUrl) {
await this._page.goto(chatUrl, {
waitUntil: 'networkidle0'
waitUntil: 'networkidle2'
})
}
// dismiss welcome modal
// dismiss welcome modal (and other modals)
do {
const modalSelector = '[data-headlessui-state="open"]'
@ -107,7 +107,7 @@ export class ChatGPTAPIBrowser {
break
}
await delay(500)
await delay(300)
} while (true)
if (!this.getIsAuthenticated()) {
@ -206,7 +206,7 @@ export class ChatGPTAPIBrowser {
try {
await maximizePage(this._page)
await this._page.reload({
waitUntil: 'networkidle0',
waitUntil: 'networkidle2',
timeout: 2 * 60 * 1000 // 2 minutes
})
await minimizePage(this._page)