diff --git a/js/embark.js b/js/embark.js index 06c05462..3b48e978 100644 --- a/js/embark.js +++ b/js/embark.js @@ -280,8 +280,8 @@ EmbarkJS.Storage.IPFS.get = function(hash) { var connectionError = new Error('No IPFS connection. Please ensure to call Embark.Storage.setProvider()'); reject(connectionError); } - EmbarkJS.Storage.ipfsConnection.object.get([hash]).then(function(node) { - resolve(node.data); + EmbarkJS.Storage.ipfsConnection.object.get(hash).then(function(node) { + resolve(node.data.toString()); }).catch(function(err) { reject(err); }); diff --git a/package.json b/package.json index 6fbe8b0d..eb448544 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "follow-redirects": "^1.2.4", "fs-extra": "^2.0.0", "globule": "^1.1.0", - "ipfs-api": "6.0.2", + "ipfs-api": "17.2.4", "merge": "^1.2.0", "mocha": "^2.2.5", "orbit-db": "^0.17.3", diff --git a/test_app/app/js/new_index.js b/test_app/app/js/new_index.js index cb1b7ba4..c708e496 100644 --- a/test_app/app/js/new_index.js +++ b/test_app/app/js/new_index.js @@ -59,19 +59,19 @@ $(document).ready(function() { //EmbarkJS.Storage.setProvider('ipfs',{server: 'localhost', port: '5001'}); $("#storage .error").hide(); - EmbarkJS.Storage.ipfsConnection.ping() - .then(function(){ + //EmbarkJS.Storage.ipfsConnection.ping() + //.then(function(){ $("#status-storage").addClass('status-online'); $("#storage-controls").show(); - }) - .catch(function(err) { - if(err){ - console.log("IPFS Connection Error => " + err.message); - $("#storage .error").show(); - $("#status-storage").addClass('status-offline'); - $("#storage-controls").hide(); - } - }); + //}) + //.catch(function(err) { + // if(err){ + // console.log("IPFS Connection Error => " + err.message); + // $("#storage .error").show(); + // $("#status-storage").addClass('status-offline'); + // $("#storage-controls").hide(); + // } + //}); $("#storage button.setIpfsText").click(function() { var value = $("#storage input.ipfsText").val();