fix: minor fix for timeouts

chatgpt-api-old-v3
Travis Fischer 2022-12-15 21:33:24 -06:00
rodzic d83e77d879
commit 8d21b551ba
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 ## 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) - 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/) 🔥 - [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) { if (url !== chatUrl) {
await this._page.goto(chatUrl, { await this._page.goto(chatUrl, {
waitUntil: 'networkidle0' waitUntil: 'networkidle2'
}) })
} }
// dismiss welcome modal // dismiss welcome modal (and other modals)
do { do {
const modalSelector = '[data-headlessui-state="open"]' const modalSelector = '[data-headlessui-state="open"]'
@ -107,7 +107,7 @@ export class ChatGPTAPIBrowser {
break break
} }
await delay(500) await delay(300)
} while (true) } while (true)
if (!this.getIsAuthenticated()) { if (!this.getIsAuthenticated()) {
@ -206,7 +206,7 @@ export class ChatGPTAPIBrowser {
try { try {
await maximizePage(this._page) await maximizePage(this._page)
await this._page.reload({ await this._page.reload({
waitUntil: 'networkidle0', waitUntil: 'networkidle2',
timeout: 2 * 60 * 1000 // 2 minutes timeout: 2 * 60 * 1000 // 2 minutes
}) })
await minimizePage(this._page) await minimizePage(this._page)