Simply use promise

This commit is contained in:
Anthony Laibe 2018-07-27 14:09:33 +01:00 committed by Iuri Matias
parent 2f8ca177e9
commit 508b37163e
1 changed files with 1 additions and 7 deletions

View File

@ -21,13 +21,7 @@ __embarkIPFS.register = function(addr, options) {
return new Error('No IPFS connection. Please ensure to call Embark.Names.setProvider()');
}
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);
});
return this._ipfsConnection.name.publish("/ipfs/" + addr, options);
};
__embarkIPFS.lookup = function () {