Simply use promise

This commit is contained in:
Anthony Laibe 2018-07-27 14:09:33 +01:00
parent ef9e76d7e6
commit 29aa0c2e92

View File

@ -21,13 +21,7 @@ __embarkIPFS.register = function(addr, options) {
return new Error('No IPFS connection. Please ensure to call Embark.Names.setProvider()'); return new Error('No IPFS connection. Please ensure to call Embark.Names.setProvider()');
} }
this._ipfsConnection.name.publish("/ipfs/" + addr, options) return this._ipfsConnection.name.publish("/ipfs/" + addr, options);
.then(res => {
return `https://gateway.ipfs.io/ipns/${res.name}`;
})
.catch((err) => {
return new Error('Unexpected Error: ' + err);
});
}; };
__embarkIPFS.lookup = function () { __embarkIPFS.lookup = function () {