|
|
@@ -240,13 +240,19 @@ class BankClient {
|
|
|
if (existing != null) {
|
|
|
return existing;
|
|
|
}
|
|
|
+ return yield this.createContact(peerId, addressType, addressValue);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ createContact(peerId, addressType, addressValue) {
|
|
|
+ return __awaiter(this, void 0, void 0, function* () {
|
|
|
const contactId = util_1.uuid();
|
|
|
const newItem = {
|
|
|
- addrs: [
|
|
|
- new contact_address_1.ContactAddress(addressType, addressValue).toPrefixedString()
|
|
|
- ],
|
|
|
+ addrs: [],
|
|
|
id: contactId
|
|
|
};
|
|
|
+ if (addressType != null && addressValue != null) {
|
|
|
+ newItem.addrs.push(new contact_address_1.ContactAddress(addressType, addressValue).toPrefixedString());
|
|
|
+ }
|
|
|
const newItemHash = yield this.uploadSlimJSON(newItem);
|
|
|
yield this.appendPrivate(peerId, '📇', newItemHash);
|
|
|
const contactBook2 = yield this.getContactBook(peerId);
|