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:
KH Soh 2026-03-25 21:25:53 +08:00 • committed by GitHub
commit 4532ae94ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1080,9 +1080,19 @@ exports.LoadUtils = () => {
const contacts = window const contacts = window
.require('WAWebCollections') .require('WAWebCollections')
.Contact.getModelsArray(); .Contact.getModelsArray();
return contacts.map((contact) => return contacts.map(async (contact) => {
window.WWebJS.getContactModel(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 }) => { window.WWebJS.mediaInfoToFile = ({ data, mimetype, filename }) => {