getProfilePicture Fix => Evaluation failed: Error: Comms::sendIq called before startComms (#1264)
* Fix: Evaluation failed: Error: Comms::sendIq called before startComms * [Requested Changes] - Only call Wap if we're not on MD & vice-versa Co-authored-by: Joaquin Touris <joaquin@192.168.1.5>
This commit is contained in:
parent
ea2cc81d47
commit
b96607338a
1 changed files with 13 additions and 4 deletions
|
|
@ -876,11 +876,20 @@ class Client extends EventEmitter {
|
||||||
* @returns {Promise<string>}
|
* @returns {Promise<string>}
|
||||||
*/
|
*/
|
||||||
async getProfilePicUrl(contactId) {
|
async getProfilePicUrl(contactId) {
|
||||||
const profilePic = await this.pupPage.evaluate((contactId) => {
|
const profilePic = await this.pupPage.evaluate(async contactId => {
|
||||||
const chatWid = window.Store.WidFactory.createWid(contactId);
|
let asyncPic;
|
||||||
return window.Store.getProfilePicFull(chatWid);
|
if (window.Store.Features.features.MD_BACKEND) {
|
||||||
|
const chatWid = window.Store.WidFactory.createWid(contactId);
|
||||||
|
asyncPic = await window.Store.getProfilePicFull(chatWid).catch(() => {
|
||||||
|
return undefined;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
asyncPic = await window.Store.Wap.profilePicFind(contactId).catch(() => {
|
||||||
|
return undefined;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return asyncPic;
|
||||||
}, contactId);
|
}, contactId);
|
||||||
|
|
||||||
return profilePic ? profilePic.eurl : undefined;
|
return profilePic ? profilePic.eurl : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue