fix: getContacts resolving all promisses (#201698)
* Fixing getContacts revolve all promisses Fixing getContacts revolve all promisses * Update Utils.js * Fixing getContactModel
This commit is contained in:
parent
cbf49be9be
commit
46c2918ff3
1 changed files with 12 additions and 18 deletions
|
|
@ -1026,11 +1026,7 @@ exports.LoadUtils = () => {
|
|||
if (!res.isBlocked) {
|
||||
const alt = window
|
||||
.require('WAWebApiContact')
|
||||
.getAlternateUserWid(
|
||||
window
|
||||
.require('WAWebWidFactory')
|
||||
.asUserWidOrThrow(contact.id),
|
||||
);
|
||||
.getAlternateUserWid(wid);
|
||||
if (alt) {
|
||||
res.isBlocked = !!window
|
||||
.require('WAWebCollections')
|
||||
|
|
@ -1080,19 +1076,17 @@ exports.LoadUtils = () => {
|
|||
const contacts = window
|
||||
.require('WAWebCollections')
|
||||
.Contact.getModelsArray();
|
||||
return contacts.map(async (contact) => {
|
||||
return Promise.all(
|
||||
contacts.map(async (contact) => {
|
||||
if (contact.isBusiness || contact.isEnterprise) {
|
||||
const contactWid = window
|
||||
.require('WAWebWidFactory')
|
||||
.createWid(contact.id);
|
||||
const bizProfile = await window
|
||||
await window
|
||||
.require('WAWebCollections')
|
||||
.BusinessProfile.find(contactWid);
|
||||
bizProfile.profileOptions &&
|
||||
(contact.businessProfile = bizProfile);
|
||||
.BusinessProfile.find(contact.id)
|
||||
.catch(() => {});
|
||||
}
|
||||
return window.WWebJS.getContactModel(contact);
|
||||
});
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
window.WWebJS.mediaInfoToFile = ({ data, mimetype, filename }) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue