Add -cwId- when findByName

This commit is contained in:
Douglas Rauber at Nitro 2024-06-24 10:37:54 -03:00
parent dfb003fd72
commit 86b2999fcf

View File

@ -736,7 +736,12 @@ export class ChatwootService {
}
this.logger.verbose('find inbox by name');
const findByName = inbox.payload.find((inbox) => inbox.name === this.getClientCwConfig().name_inbox);
let findByName = inbox.payload.find((inbox) => inbox.name === this.getClientCwConfig().name_inbox);
if (!findByName) {
findByName = inbox.payload.find((inbox) => inbox.name === this.getClientCwConfig().name_inbox.split('-cwId-')[0]);
}
if (!findByName) {
this.logger.warn('inbox not found');