fix: Fix/get contacts for biz contacts (#201680)
* Updated WWebJS.getContacts to handle business or enterprise contacts properly * Added missing return statement
This commit is contained in:
parent
7f54af0986
commit
4532ae94ae
1 changed files with 13 additions and 3 deletions
|
|
@ -1080,9 +1080,19 @@ exports.LoadUtils = () => {
|
|||
const contacts = window
|
||||
.require('WAWebCollections')
|
||||
.Contact.getModelsArray();
|
||||
return contacts.map((contact) =>
|
||||
window.WWebJS.getContactModel(contact),
|
||||
);
|
||||
return contacts.map(async (contact) => {
|
||||
if (contact.isBusiness || contact.isEnterprise) {
|
||||
const contactWid = window
|
||||
.require('WAWebWidFactory')
|
||||
.createWid(contact.id);
|
||||
const bizProfile = await window
|
||||
.require('WAWebCollections')
|
||||
.BusinessProfile.find(contactWid);
|
||||
bizProfile.profileOptions &&
|
||||
(contact.businessProfile = bizProfile);
|
||||
}
|
||||
return window.WWebJS.getContactModel(contact);
|
||||
});
|
||||
};
|
||||
|
||||
window.WWebJS.mediaInfoToFile = ({ data, mimetype, filename }) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue