From 60220d9ad4dbd79c8fe55d01e63f27f10d696019 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Wed, 15 Sep 2021 16:06:30 +0530 Subject: [PATCH] bug fixes - fixed a bug causing chart to throw error - fixed a bug causing accounts details to have extra progress step --- index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 85d4796..a292c78 100644 --- a/index.html +++ b/index.html @@ -1436,7 +1436,7 @@ } function renderAccountProgress(index) { - const { type, status, openTime, closeTime = 0, amount, netAmt } = bank_app.getUserDetails(myFloID).accounts[index] + const { type, status, openTime, closeTime = undefined, amount, netAmt } = bank_app.getUserDetails(myFloID).accounts[index] getRef('account_process__steps').innerHTML = '' getRef('account_process__steps').append(render.accountProgressStep('success', type === "deposit" ? 'Deposited' : 'Got loan', getFormattedTime(openTime))) const { isPending, pendingRequest } = getAccountStatus(index) @@ -1444,14 +1444,14 @@ if (isPending) { getRef('account_process__steps').append(render.accountProgressStep('success', 'Sent withdrawal request', getFormattedTime(pendingRequest.split('_')[0]))) getRef('account_process__steps').append(render.accountProgressStep('pending', 'Waiting for withdrawal confirmation', `Once your request is processed, your withdrawn amount will reflect in your balance.
meanwhile you can go back and continue using the app.`)) - } else { + } else if (closeTime) { getRef('account_process__steps').append(render.accountProgressStep('success', 'Withdrawal complete', getFormattedTime(closeTime))) } } else { if (isPending) { getRef('account_process__steps').append(render.accountProgressStep('success', 'Sent repay request', getFormattedTime(pendingRequest.split('_')[0]))) getRef('account_process__steps').append(render.accountProgressStep('pending', 'Waiting for repayment confirmation', `Once your request is processed, your loan will be closed,`)) - } else { + } else if (closeTime) { getRef('account_process__steps').append(render.accountProgressStep('success', 'Repayment complete', getFormattedTime(closeTime))) } } @@ -1502,7 +1502,7 @@ bank_app.withdrawDeposit(parseInt(index)) .then(res => { getRef('account_process__steps').lastElementChild.remove() - renderAccountProgress() + renderAccountProgress(index) }) .catch(err => { getRef('account_process__steps') @@ -1514,7 +1514,7 @@ bank_app.repayLoan(parseInt(index)) .then(res => { getRef('account_process__steps').lastElementChild.remove() - renderAccountProgress() + renderAccountProgress(index) }) .catch(err => { getRef('account_process__steps') @@ -1535,7 +1535,7 @@ function updateChart() { const { depositTotal, loanTotal } = bank_app.getUserDetails(myFloID) - if (accountChart) { + if (accountChart && isChartVisible) { accountChart.data.datasets[0].data = [depositTotal, loanTotal] accountChart.update() }