Add checks for undefined values before saving metadata to meta server.
This commit is contained in:
parent
28f87d7ff9
commit
665b28a8ba
@ -90,17 +90,37 @@ export class UserService {
|
||||
},
|
||||
location: {},
|
||||
};
|
||||
if (name) {
|
||||
accountInfo.vcard.fn[0].value = name;
|
||||
accountInfo.vcard.n[0].value = name.split(' ');
|
||||
}
|
||||
if (phoneNumber) {
|
||||
accountInfo.vcard.tel[0].value = phoneNumber;
|
||||
}
|
||||
if (bio) {
|
||||
accountInfo.products = [bio];
|
||||
}
|
||||
if (gender) {
|
||||
accountInfo.gender = gender;
|
||||
}
|
||||
if (age) {
|
||||
accountInfo.age = age;
|
||||
}
|
||||
if (type) {
|
||||
accountInfo.type = type;
|
||||
}
|
||||
if (businessCategory) {
|
||||
accountInfo.category = businessCategory;
|
||||
}
|
||||
if (location) {
|
||||
accountInfo.location.area = location;
|
||||
}
|
||||
if (userLocation) {
|
||||
accountInfo.location.area_name = userLocation;
|
||||
}
|
||||
if (locationType) {
|
||||
accountInfo.location.area_type = locationType;
|
||||
}
|
||||
await vcardValidation(accountInfo.vcard);
|
||||
accountInfo.vcard = btoa(vCard.generate(accountInfo.vcard));
|
||||
const accountKey: string = await User.toKey(address);
|
||||
|
@ -94,7 +94,7 @@ export class AccountDetailsComponent implements OnInit {
|
||||
firstName: ['', Validators.required],
|
||||
lastName: ['', Validators.required],
|
||||
phoneNumber: ['', Validators.required],
|
||||
age: ['', Validators.required],
|
||||
age: [''],
|
||||
type: ['', Validators.required],
|
||||
bio: ['', Validators.required],
|
||||
gender: ['', Validators.required],
|
||||
|
Loading…
Reference in New Issue
Block a user