Don't put empty username into backup

This commit is contained in:
Fedor Indutny 2024-04-16 17:40:41 +02:00 committed by GitHub
parent 6f92bcd86b
commit 4539a178c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -335,15 +335,19 @@ export class BackupExportStream extends Readable {
throw missingCaseError(rawPhoneNumberSharingMode);
}
const usernameLink = storage.get('usernameLink');
return {
profileKey: storage.get('profileKey'),
username: me.get('username'),
usernameLink: {
...(storage.get('usernameLink') ?? {}),
username: me.get('username') || null,
usernameLink: usernameLink
? {
...usernameLink,
// Same numeric value, no conversion needed
color: storage.get('usernameLinkColor'),
},
// Same numeric value, no conversion needed
color: storage.get('usernameLinkColor'),
}
: null,
givenName: me.get('profileName'),
familyName: me.get('profileFamilyName'),
avatarUrlPath: storage.get('avatarUrl'),