diff --git a/src/3box.js b/src/3box.js index 73e7807b..460e094a 100644 --- a/src/3box.js +++ b/src/3box.js @@ -593,7 +593,8 @@ class Box { const item = Object.assign({}, entry) item.linkId = item.entry.hash delete item.entry - return item + list.push(item) + return list }, []) } @@ -621,6 +622,10 @@ class Box { } await this._writeAddressLink(linkData) + } else { + // Send consentSignature to 3box-address-server to link profile with ethereum address + // _writeAddressLink already does this if the other conditional is called + utils.fetchJson(this._serverUrl + '/link', linkData).catch(console.error) } // Ensure we self-published our did @@ -629,12 +634,11 @@ class Box { await this.public.set('proof_did', await this._3id.signJWT(), { noLink: true }) } - // Send consentSignature to 3box-address-server to link profile with ethereum address - utils.fetchJson(this._serverUrl + '/link', linkData).catch(console.error) } async _writeAddressLink (proof) { const data = (await this._ipfs.dag.put(proof)).toBaseEncodedString() + utils.fetchJson(this._serverUrl + '/link', proof).catch(console.error) const linkExist = await this._linkCIDExists(data) if (linkExist) return const link = {