From 58d6a4150552f7bd24c0139bd38cd286f7f303aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Thu, 13 May 2021 22:44:42 +0100 Subject: [PATCH] fix: unused variable and code simplification --- .../pages/Maintenance/Wizard/WizardStep.js | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.js b/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.js index b4e52d4c..857f6a86 100644 --- a/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.js +++ b/new-lamassu-admin/src/pages/Maintenance/Wizard/WizardStep.js @@ -120,16 +120,12 @@ const WizardStep = ({ denomination: step === 2 ? cashoutSettings.top : cashoutSettings.bottom } - const getPercentage = values => - R.clamp( - 0, - 100, - (100 * - (step === 2 - ? values.cassette1Count ?? cassetteInfo.amount - : values.cassette2Count ?? cassetteInfo.amount)) / - cassetteCapacity - ) + const getPercentage = values => { + const cassetteCount = + step === 2 ? values.cassette1Count : values.cassette2Count + const value = cassetteCount ?? cassetteInfo.amount + return R.clamp(0, 100, 100 * (value / cassetteCapacity)) + } return (
@@ -173,7 +169,12 @@ const WizardStep = ({ classes.centerAlignment )}>

Since previous update

- Insert tooltip text here. + +

+ Number of bills inside the cashbox, since the last + cashbox changes. +

+

accepted bills

- {steps[step - 1].fiatAmount && ( -

- = {steps[step - 1].fiatAmount} {fiatCurrency} -

- )}