mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-12 06:54:58 +00:00
Added logic to show error message on console if fails to save and retrieve text from IPFS
This commit is contained in:
parent
f1b8438cbb
commit
74343ceb60
@ -51,16 +51,26 @@ $(document).ready(function() {
|
|||||||
EmbarkJS.Storage.saveText(value).then(function(hash) {
|
EmbarkJS.Storage.saveText(value).then(function(hash) {
|
||||||
$("span.textHash").html(hash);
|
$("span.textHash").html(hash);
|
||||||
$("input.textHash").val(hash);
|
$("input.textHash").val(hash);
|
||||||
});
|
|
||||||
addToLog("#storage", "EmbarkJS.Storage.saveText('" + value + "').then(function(hash) { })");
|
addToLog("#storage", "EmbarkJS.Storage.saveText('" + value + "').then(function(hash) { })");
|
||||||
|
})
|
||||||
|
.catch(function(err) {
|
||||||
|
if(err){
|
||||||
|
console.log("IPFS saveText Error => " + err.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#storage button.loadIpfsHash").click(function() {
|
$("#storage button.loadIpfsHash").click(function() {
|
||||||
var value = $("#storage input.textHash").val();
|
var value = $("#storage input.textHash").val();
|
||||||
EmbarkJS.Storage.get(value).then(function(content) {
|
EmbarkJS.Storage.get(value).then(function(content) {
|
||||||
$("span.ipfsText").html(content);
|
$("span.ipfsText").html(content);
|
||||||
});
|
|
||||||
addToLog("#storage", "EmbarkJS.Storage.get('" + value + "').then(function(content) { })");
|
addToLog("#storage", "EmbarkJS.Storage.get('" + value + "').then(function(content) { })");
|
||||||
|
})
|
||||||
|
.catch(function(err) {
|
||||||
|
if(err){
|
||||||
|
console.log("IPFS get Error => " + err.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#storage button.uploadFile").click(function() {
|
$("#storage button.uploadFile").click(function() {
|
||||||
@ -68,8 +78,13 @@ $(document).ready(function() {
|
|||||||
EmbarkJS.Storage.uploadFile(input).then(function(hash) {
|
EmbarkJS.Storage.uploadFile(input).then(function(hash) {
|
||||||
$("span.fileIpfsHash").html(hash);
|
$("span.fileIpfsHash").html(hash);
|
||||||
$("input.fileIpfsHash").val(hash);
|
$("input.fileIpfsHash").val(hash);
|
||||||
});
|
|
||||||
addToLog("#storage", "EmbarkJS.Storage.uploadFile($('input[type=file]')).then(function(hash) { })");
|
addToLog("#storage", "EmbarkJS.Storage.uploadFile($('input[type=file]')).then(function(hash) { })");
|
||||||
|
})
|
||||||
|
.catch(function(err) {
|
||||||
|
if(err){
|
||||||
|
console.log("IPFS uploadFile Error => " + err.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#storage button.loadIpfsFile").click(function() {
|
$("#storage button.loadIpfsFile").click(function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user