mirror of https://github.com/embarklabs/embark.git
fix storage getUrl method override issue
This commit is contained in:
parent
be64d2ff6b
commit
8b313a0fc7
|
@ -309,10 +309,10 @@ EmbarkJS.Storage.setProvider = function(provider, options) {
|
||||||
try {
|
try {
|
||||||
if (options === undefined) {
|
if (options === undefined) {
|
||||||
self.ipfsConnection = IpfsApi('localhost', '5001');
|
self.ipfsConnection = IpfsApi('localhost', '5001');
|
||||||
self.getUrl = "http://localhost:8080/ipfs/";
|
self._getUrl = "http://localhost:8080/ipfs/";
|
||||||
} else {
|
} else {
|
||||||
self.ipfsConnection = IpfsApi(options.server, options.port);
|
self.ipfsConnection = IpfsApi(options.server, options.port);
|
||||||
self.getUrl = options.getUrl || "http://localhost:8080/ipfs/";
|
self._getUrl = options.getUrl || "http://localhost:8080/ipfs/";
|
||||||
}
|
}
|
||||||
resolve(self);
|
resolve(self);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -402,7 +402,7 @@ EmbarkJS.Storage.IPFS.uploadFile = function(inputSelector) {
|
||||||
};
|
};
|
||||||
|
|
||||||
EmbarkJS.Storage.IPFS.getUrl = function(hash) {
|
EmbarkJS.Storage.IPFS.getUrl = function(hash) {
|
||||||
return (self.getUrl || "http://localhost:8080/ipfs/") + hash;
|
return (self._getUrl || "http://localhost:8080/ipfs/") + hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
//=========================================================
|
//=========================================================
|
||||||
|
|
|
@ -227,10 +227,10 @@ EmbarkJS.Storage.setProvider = function(provider, options) {
|
||||||
try {
|
try {
|
||||||
if (options === undefined) {
|
if (options === undefined) {
|
||||||
self.ipfsConnection = IpfsApi('localhost', '5001');
|
self.ipfsConnection = IpfsApi('localhost', '5001');
|
||||||
self.getUrl = "http://localhost:8080/ipfs/";
|
self._getUrl = "http://localhost:8080/ipfs/";
|
||||||
} else {
|
} else {
|
||||||
self.ipfsConnection = IpfsApi(options.server, options.port);
|
self.ipfsConnection = IpfsApi(options.server, options.port);
|
||||||
self.getUrl = options.getUrl || "http://localhost:8080/ipfs/";
|
self._getUrl = options.getUrl || "http://localhost:8080/ipfs/";
|
||||||
}
|
}
|
||||||
resolve(self);
|
resolve(self);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -320,7 +320,7 @@ EmbarkJS.Storage.IPFS.uploadFile = function(inputSelector) {
|
||||||
};
|
};
|
||||||
|
|
||||||
EmbarkJS.Storage.IPFS.getUrl = function(hash) {
|
EmbarkJS.Storage.IPFS.getUrl = function(hash) {
|
||||||
return (self.getUrl || "http://localhost:8080/ipfs/") + hash;
|
return (self._getUrl || "http://localhost:8080/ipfs/") + hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
//=========================================================
|
//=========================================================
|
||||||
|
|
Loading…
Reference in New Issue