From ad5744aa7d87b746c3af8ee9dc2d25a8f1df718c Mon Sep 17 00:00:00 2001 From: rodrigorodriguez Date: Tue, 4 Oct 2022 15:44:57 -0300 Subject: [PATCH] new(all): Custom Domain support per bot. --- packages/whatsapp.gblib/services/WhatsappDirectLine.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts index e600780a..e5123f39 100644 --- a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts +++ b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts @@ -156,9 +156,6 @@ export class WhatsappDirectLine extends GBService { }); - await client.initialize(); - this.browserWSEndpoint = client.pupBrowser.wsEndpoint(); - client.on('message', (async message => { await this.WhatsAppCallback(message, null); }).bind(this)); @@ -197,6 +194,7 @@ export class WhatsappDirectLine extends GBService { }).bind(this)); client.on('authenticated', () => { + this.browserWSEndpoint = client.pupBrowser.wsEndpoint(); GBLog.info(`WhatsApp QR Code authenticated for ${this.botId}.`); }); @@ -215,7 +213,8 @@ export class WhatsappDirectLine extends GBService { await (createClient.bind(this))(this.browserWSEndpoint); - + client.initialize(); + setUrl = false; } break;