Skip to content

Commit

Permalink
fix: Migrated ProfilePicThumb functions to WA-JS
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Nov 28, 2021
1 parent eb9677c commit 5cd98d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/lib/wapi/serializers/serialize-contact.js
Expand Up @@ -22,8 +22,8 @@ export const _serializeContactObj = (obj) => {

let profile = null;

if (!obj.profilePicThumb && obj.id && window.Store.ProfilePicThumb) {
let thumb = window.Store.ProfilePicThumb.get(obj.id);
if (!obj.profilePicThumb && obj.id && WPP.whatsapp.ProfilePicThumbStore) {
let thumb = WPP.whatsapp.ProfilePicThumbStore.get(obj.id);
profile = thumb ? WAPI._serializeProfilePicThumb(thumb) : {};
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/wapi/serializers/serialize-profilePic.js
Expand Up @@ -17,10 +17,10 @@

export const _profilePicfunc = async (id) => {
const wid = WPP.whatsapp.WidFactory.createDeviceWid(id);
let pic = Store.ProfilePicThumb.get(wid);
let pic = WPP.whatsapp.ProfilePicThumbStore.get(wid);

if (!pic) {
pic = await Store.ProfilePicThumb.find(wid);
pic = await WPP.whatsapp.ProfilePicThumbStore.find(wid);
}

if (pic) {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/wapi/wapi.js
Expand Up @@ -366,7 +366,7 @@ if (typeof window.WAPI === 'undefined') {
};

window.WAPI.getProfilePicSmallFromId = async function (id) {
return await window.Store.ProfilePicThumb.find(id).then(
return await WPP.whatsapp.ProfilePicThumbStore.find(id).then(
async function (d) {
if (d.img !== undefined) {
return await window.WAPI.downloadFileWithCredentials(d.img);
Expand All @@ -381,7 +381,7 @@ if (typeof window.WAPI === 'undefined') {
};

window.WAPI.getProfilePicFromId = async function (id) {
return await window.Store.ProfilePicThumb.find(id).then(
return await WPP.whatsapp.ProfilePicThumbStore.find(id).then(
async function (d) {
if (d.imgFull !== undefined) {
return await window.WAPI.downloadFileWithCredentials(d.imgFull);
Expand Down

0 comments on commit 5cd98d0

Please sign in to comment.