From 8ffc62ed67dcd540ed586bda9248594248a067ff Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Fri, 4 Apr 2025 18:27:39 -0300 Subject: [PATCH] fix(app): comment out boot instance creation and saving in legacy mode --- packages/core.gbapp/services/GBMinService.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/core.gbapp/services/GBMinService.ts b/packages/core.gbapp/services/GBMinService.ts index 9f925727..34a409c3 100644 --- a/packages/core.gbapp/services/GBMinService.ts +++ b/packages/core.gbapp/services/GBMinService.ts @@ -492,8 +492,17 @@ export class GBMinService { // Not meta, multiples bots on root bot. if (!req.body.object) { - const to = req.body.To.replace(/whatsapp\:\+/gi, ''); - whatsAppDirectLine = WhatsappDirectLine.botsByNumber[to]; + + if (req.body.To){ + + const to = req.body.To.replace(/whatsapp\:\+/gi, ''); + whatsAppDirectLine = WhatsappDirectLine.botsByNumber[to]; + } + else + { + const minBoot = GBServer.globals.minBoot as GBMinInstance; + whatsAppDirectLine = minBoot.whatsAppDirectLine; + } } if (whatsAppDirectLine) {