fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
Showing only changes of commit 134cf31695 - Show all commits

View file

@ -137,9 +137,11 @@ export class GBMinService {
res.end();
return; // Exit here.
}
let activeMin;
if (process.env.WHATSAPP_WELCOME_DISABLED !== "true") {
const toSwitchMin = GBServer.globals.minInstances.filter(p => p.botId === text)[0];
let activeMin = toSwitchMin ? toSwitchMin : GBServer.globals.minBoot;
activeMin = toSwitchMin ? toSwitchMin : GBServer.globals.minBoot;
let sec = new SecService();
let user = await sec.getUserFromPhone(id);
@ -161,9 +163,14 @@ export class GBMinService {
(activeMin as any).whatsAppDirectLine.received(req, res);
}
}
}
else {
(GBServer.globals.minBoot as any).whatsAppDirectLine.received(req, res);
}
} catch (error) {
GBLog.error(`Error on Whatsapp callback: ${error.message}`);
}
});
await Promise.all(