Include badgeIds when writing profile data
This commit is contained in:
parent
1ce39478a2
commit
c9678c4877
1 changed files with 10 additions and 2 deletions
|
@ -16,8 +16,15 @@ export async function encryptProfileData(
|
||||||
conversation: ConversationType,
|
conversation: ConversationType,
|
||||||
avatarBuffer?: Uint8Array
|
avatarBuffer?: Uint8Array
|
||||||
): Promise<[ProfileRequestDataType, Uint8Array | undefined]> {
|
): Promise<[ProfileRequestDataType, Uint8Array | undefined]> {
|
||||||
const { aboutEmoji, aboutText, familyName, firstName, profileKey, uuid } =
|
const {
|
||||||
conversation;
|
aboutEmoji,
|
||||||
|
aboutText,
|
||||||
|
badges,
|
||||||
|
familyName,
|
||||||
|
firstName,
|
||||||
|
profileKey,
|
||||||
|
uuid,
|
||||||
|
} = conversation;
|
||||||
|
|
||||||
assert(profileKey, 'profileKey');
|
assert(profileKey, 'profileKey');
|
||||||
assert(uuid, 'uuid');
|
assert(uuid, 'uuid');
|
||||||
|
@ -57,6 +64,7 @@ export async function encryptProfileData(
|
||||||
name: Bytes.toBase64(bytesName),
|
name: Bytes.toBase64(bytesName),
|
||||||
about: bytesAbout ? Bytes.toBase64(bytesAbout) : null,
|
about: bytesAbout ? Bytes.toBase64(bytesAbout) : null,
|
||||||
aboutEmoji: bytesAboutEmoji ? Bytes.toBase64(bytesAboutEmoji) : null,
|
aboutEmoji: bytesAboutEmoji ? Bytes.toBase64(bytesAboutEmoji) : null,
|
||||||
|
badgeIds: (badges || []).map(({ id }) => id),
|
||||||
paymentAddress: window.storage.get('paymentAddress') || null,
|
paymentAddress: window.storage.get('paymentAddress') || null,
|
||||||
avatar: Boolean(avatarBuffer),
|
avatar: Boolean(avatarBuffer),
|
||||||
commitment: deriveProfileKeyCommitment(profileKey, uuid),
|
commitment: deriveProfileKeyCommitment(profileKey, uuid),
|
||||||
|
|
Loading…
Add table
Reference in a new issue