From 42ec4741fe415180567dd167a1056d708b4fe9a7 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Fri, 13 May 2022 19:14:56 +0530 Subject: [PATCH] minor error handling --- scripts/fn_ui.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/fn_ui.js b/scripts/fn_ui.js index 3850f15..dc4ab95 100644 --- a/scripts/fn_ui.js +++ b/scripts/fn_ui.js @@ -380,7 +380,7 @@ function getFloIdTitle(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' }) } @@ -428,8 +428,7 @@ const render = { return clone; }, cashierRequestCard(details) { - const { time, senderID, message: { mode, amount }, note, tag, vectorClock } = details; - console.log(amount) + const { time, senderID, message: { mode, amount = 0 }, note, tag, vectorClock } = 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