From 170bc8b1c99d5b63571e048f8c0dc3bf0dc6bc09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Tue, 16 Mar 2021 17:53:18 +0000 Subject: [PATCH] fix: remove unnecessary call to object --- new-lamassu-admin/src/pages/Commissions/helper.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/new-lamassu-admin/src/pages/Commissions/helper.js b/new-lamassu-admin/src/pages/Commissions/helper.js index a07fff4b..e57b84e8 100644 --- a/new-lamassu-admin/src/pages/Commissions/helper.js +++ b/new-lamassu-admin/src/pages/Commissions/helper.js @@ -40,11 +40,9 @@ const getView = (data, code, compare) => it => { if (!data) return '' // The following boolean should come undefined if it is rendering an unpaired machine - const findAttribute = R.find(R.propEq(compare ?? 'code', it)) + const attribute = R.find(R.propEq(compare ?? 'code', it))(data) - return findAttribute(data) - ? R.compose(R.prop(code), findAttribute)(data) - : 'Unpaired machine' + return attribute ? R.prop(code, attribute) : 'Unpaired machine' } const displayCodeArray = data => it => {