This commit is contained in:
Zuilho Segundo 2023-03-20 16:35:10 -03:00
commit cd0187f051
3 changed files with 16 additions and 12 deletions

View file

@ -773,6 +773,7 @@ export class GBMinService {
await min.whatsAppDirectLine.setup(true); await min.whatsAppDirectLine.setup(true);
} else { } else {
const minBoot = GBServer.globals.minBoot as any; const minBoot = GBServer.globals.minBoot as any;
if (min !== minBoot) {
min.whatsAppDirectLine = new WhatsappDirectLine( min.whatsAppDirectLine = new WhatsappDirectLine(
min, min,
min.botId, min.botId,
@ -784,6 +785,7 @@ export class GBMinService {
); );
await min.whatsAppDirectLine.setup(false); await min.whatsAppDirectLine.setup(false);
} }
}
// Setups default BOT Framework dialogs. // Setups default BOT Framework dialogs.

View file

@ -295,7 +295,9 @@ export class GBSSR {
if (!min) { if (!min) {
min = req.url === '/' min = req.url === '/'
? minBoot ? minBoot
: GBServer.globals.minInstances.filter(p => p.instance.activationCode.toLowerCase() === botId.toLowerCase())[0]; : GBServer.globals.minInstances.filter(p =>
p.instance.activationCode ? p.instance.activationCode.toLowerCase() === botId.toLowerCase()
: null)[0];
} }
if (!min) { if (!min) {
botId = minBoot.botId; botId = minBoot.botId;

View file

@ -1042,7 +1042,7 @@ export class WhatsappDirectLine extends GBService {
} }
} }
// Detects if the welcome message is enabled.z // Detects if the welcome message is enabled.
if (process.env.WHATSAPP_WELCOME_DISABLED !== 'true') { if (process.env.WHATSAPP_WELCOME_DISABLED !== 'true') {
// Tries to find if user wants to switch bots. // Tries to find if user wants to switch bots.