Skip to content

Commit

Permalink
fix: Fixed setProfilePic function for BETA(multidevice)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Aug 4, 2021
1 parent 255db87 commit 0824b65
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/wapi/functions/set-profile-pic.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@
*/
export async function setProfilePic(obj, id) {
if (!id) {
id = Store.Me.attributes.wid._serialized;
id = Store.UserPrefs.getMaybeMeUser();
}
const wid = Store.WidFactory.createWid(id);

let base64 = 'data:image/jpeg;base64,';
return await Store.Profile.sendSetPicture(id, base64 + obj.b, base64 + obj.a);
return await Store.Profile.sendSetPicture(
wid,
base64 + obj.b,
base64 + obj.a
);
}

0 comments on commit 0824b65

Please sign in to comment.