Skip to content

Commit

Permalink
feat: get profile connection
Browse files Browse the repository at this point in the history
  • Loading branch information
jonalan7 committed Oct 6, 2021
1 parent b342e23 commit b57455e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/lib/wapi/serializers/serielize-me.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,31 @@ export const _serializeMeObj = async (obj) => {
if (obj == undefined) {
return null;
}

const status = await Store.MyStatus.getStatus(obj.wid._serialized);
const image = await Store.Profile.profilePicFindThumbFromPhone(
obj.wid._serialized
);
const appsImage = Store.Profile.profilePicFind(obj.wid._serialized);
const appsImage = await Store.Profile.profilePicFind(obj.wid._serialized);
const connection = await window.Store.State.default.state;

return Object.assign(
{},
{
battery: obj.battery,
connected: obj.connected,
locales: obj.locales,
statusConnection: connection,
phone: {
device_manufacturer: obj.phone.device_manufacturer,
device_model: obj.phone.device_model,
os_version: obj.phone.os_version,
wa_version: obj.phone.wa_version
wa_version: obj.phone.wa_version,
},
pushname: obj.pushname,
status: status.status,
imageBase64: image.raw,
appsImage: appsImage.eurl,
appsImage: appsImage && appsImage.eurl? appsImage.eurl: undefined,
wid: {
server: obj.wid.server,
user: obj.wid.user,
_serialized: obj.wid._serialized
}
_serialized: obj.wid._serialized,
},
}
);
};

0 comments on commit b57455e

Please sign in to comment.