minor error handling

This commit is contained in:
sairaj mote 2022-05-13 19:14:56 +05:30
parent 5cf49939d6
commit 42ec4741fe

View File

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