From 12fb0daeee4096e4683b12bb69690308d0565530 Mon Sep 17 00:00:00 2001 From: rodrigorodriguez Date: Sun, 9 Oct 2022 17:47:38 -0300 Subject: [PATCH] new(all): Custom Domain support per bot. --- packages/whatsapp.gblib/services/WhatsappDirectLine.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts index 486477be..92d0744c 100644 --- a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts +++ b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts @@ -162,8 +162,6 @@ export class WhatsappDirectLine extends GBService { puppeteer: puppeteer }); - await client.initialize(); - this.browserWSEndpoint = client.pupBrowser.wsEndpoint(); client.on('message', (async message => { await this.WhatsAppCallback(message, null); @@ -227,6 +225,8 @@ export class WhatsappDirectLine extends GBService { GBLog.info(`Browser terminated. Restarting ${this.min.botId} WhatsApp native provider.`); await (createClient.bind(this))(null); }).bind(this)); + + client.initialize(); }; await (createClient.bind(this))(this.browserWSEndpoint);