Skip to content

Commit

Permalink
Reindent
Browse files Browse the repository at this point in the history
  • Loading branch information
brson committed Jul 29, 2020
1 parent 36b86a8 commit ebd2a91
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions www/js/update.js
Expand Up @@ -59,20 +59,20 @@ async function submit() {
console.assert(priceinput);

if (!validNumber(priceinput)) {
document.getElementById("price-alarming").innerText = " * Please fill in number.";
enableInputs();
} else {
let price = parseInt(priceinput);

if (price <= showPrice) {
document.getElementById("price-alarming").innerText = " * Your price shall be greater than the current";
document.getElementById("price-alarming").innerText = " * Please fill in number.";
enableInputs();
} else {
await storeMessage(contractAbi,
contractAddress,
message,
price);
}
} else {
let price = parseInt(priceinput);

if (price <= showPrice) {
document.getElementById("price-alarming").innerText = " * Your price shall be greater than the current";
enableInputs();
} else {
await storeMessage(contractAbi,
contractAddress,
message,
price);
}
}
}

Expand All @@ -81,9 +81,9 @@ function validNumber(inputNumber) {
console.log(inputNumber);

if (regular.test(inputNumber)) {
return true;
return true;
} else {
return false;
return false;
}
}

Expand Down Expand Up @@ -119,8 +119,8 @@ async function storeMessage(contractAbi, contractAddress, message, priceinput) {
console.log(message);

let addedNode = node.add({
path: 'message.txt',
content: message
path: 'message.txt',
content: message
});
addedNode = await addedNode;
let cid = addedNode.cid.toString();
Expand All @@ -138,31 +138,31 @@ async function storeMessage(contractAbi, contractAddress, message, priceinput) {
contract.methods
.setContent(cid)
.send({from: account, value: priceinput})
.on('transactionHash', function(hash){
console.log('transactionHash');
console.log(hash);
.on('transactionHash', function(hash){
console.log('transactionHash');
console.log(hash);
uiUpdateEthTransactionHash(hash);
})
.on('receipt', function(receipt){
console.log('receipt');
console.log(receipt);
})
.on('receipt', function(receipt){
console.log('receipt');
console.log(receipt);
// todo
})
.on('confirmation', function(confirmationNumber, receipt){
console.log('confirmation');
console.log(confirmationNumber);
console.log(receipt);
})
.on('confirmation', function(confirmationNumber, receipt){
console.log('confirmation');
console.log(confirmationNumber);
console.log(receipt);
uiUpdateEthTransactionConfirmation(confirmationNumber);

if (confirmationNumber == 0) {
uiEndProcessSuccess();
}
})
.on('error', function(error){
console.log('error');
console.log(error);
})
.on('error', function(error){
console.log('error');
console.log(error);
uiUpdateEthTransactionError(error);
});
});

console.log("waiting on Ethereum");
}
Expand Down

0 comments on commit ebd2a91

Please sign in to comment.