From b57455e2b80882f4735571d5ff69a89c80fac8b3 Mon Sep 17 00:00:00 2001 From: jonalan Date: Wed, 6 Oct 2021 10:22:17 -0300 Subject: [PATCH] feat: get profile connection --- src/lib/wapi/serializers/serielize-me.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/lib/wapi/serializers/serielize-me.js b/src/lib/wapi/serializers/serielize-me.js index aa92db90f..a18fbe105 100644 --- a/src/lib/wapi/serializers/serielize-me.js +++ b/src/lib/wapi/serializers/serielize-me.js @@ -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, + }, } ); };