fix storage getUrl method override issue

This commit is contained in:
Iuri Matias 2017-12-15 17:43:18 -05:00
parent 97231caad8
commit d094035f21
2 changed files with 9 additions and 6 deletions

View File

@ -43,6 +43,9 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ // expose the module cache /******/ // expose the module cache
/******/ __webpack_require__.c = installedModules; /******/ __webpack_require__.c = installedModules;
/******/ /******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports /******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) { /******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) { /******/ if(!__webpack_require__.o(exports, name)) {
@ -306,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) {
@ -399,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;
}; };
//========================================================= //=========================================================

View File

@ -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;
}; };
//========================================================= //=========================================================