mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-22 11:40:09 +00:00
Simply use promise
This commit is contained in:
parent
ef9e76d7e6
commit
29aa0c2e92
@ -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 () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user