user 6 năm trước cách đây
mục cha
commit
dd543c61b9
3 tập tin đã thay đổi với 5 bổ sung3 xóa
  1. 2 1
      lib/index.js
  2. 1 1
      lib/index.js.map
  3. 2 1
      src/index.ts

+ 2 - 1
lib/index.js

@@ -281,9 +281,10 @@ class BankClient {
             if (!existing) {
                 throw new Error('missing contact with id ' + contactId);
             }
+            const existingData = existing.getData();
             const newProps = util_1.mergeDeep({}, newProperties);
             delete newProps.id;
-            const newItem = util_1.mergeDeep(existing, newProps);
+            const newItem = util_1.mergeDeep(existingData, newProps);
             delete newItem.hash;
             const newItemHash = yield this.uploadSlimJSON(newItem);
             yield this.appendPrivate(peerId, '📇', newItemHash, existing.hash);

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
lib/index.js.map


+ 2 - 1
src/index.ts

@@ -272,9 +272,10 @@ export class BankClient {
       if (!existing) {
         throw new Error('missing contact with id ' + contactId);
       }
+      const existingData = existing.getData();
       const newProps: any = mergeDeep({}, newProperties);
       delete newProps.id;
-      const newItem: any = mergeDeep(existing, newProps);
+      const newItem: any = mergeDeep(existingData, newProps);
       delete newItem.hash;
       const newItemHash = await this.uploadSlimJSON(newItem);
       await this.appendPrivate(peerId, '📇', newItemHash, existing.hash);