update ipfs lib

This commit is contained in:
Iuri Matias 2017-12-13 10:59:53 -05:00
parent 0b00f99f09
commit 12c8e223d6
3 changed files with 14 additions and 14 deletions

View File

@ -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);
});

View File

@ -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",

View File

@ -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();