error handling

This commit is contained in:
sairaj mote 2022-05-13 19:26:15 +05:30
parent 42ec4741fe
commit 7907a0a389
2 changed files with 4 additions and 1 deletions

View File

@ -1102,7 +1102,7 @@
getRef('rupee_balance').innerHTML = `<span><b>${beforeDecimal}</b></span>.<span>${afterDecimal}</span>`
})
floBlockchainAPI.getBalance(myFloID).then(balance => {
const [beforeDecimal, afterDecimal] = String(balance).split('.')
const [beforeDecimal, afterDecimal = '0'] = String(balance).split('.')
getRef('flo_balance').innerHTML = `<span><b>${beforeDecimal}</b></span>.<span>${afterDecimal}</span>`
})
if (floGlobals.isSubAdmin) {

View File

@ -381,6 +381,8 @@ function getFloIdTitle(floID) {
}
function formatAmount(amount = 0) {
if (!amount)
return '0';
return amount.toLocaleString(`en-IN`, { style: 'currency', currency: 'INR' })
}
@ -429,6 +431,7 @@ const render = {
},
cashierRequestCard(details) {
const { time, senderID, message: { mode, amount = 0 }, note, tag, vectorClock } = details;
console.log(details);
const clone = getRef('cashier_request_template').content.cloneNode(true).firstElementChild;
clone.id = vectorClock;
const status = tag || note; //status tag for completed, note for rejected