fix: remove unnecessary call to object
This commit is contained in:
parent
4d62506c25
commit
170bc8b1c9
1 changed files with 2 additions and 4 deletions
|
|
@ -40,11 +40,9 @@ const getView = (data, code, compare) => it => {
|
||||||
if (!data) return ''
|
if (!data) return ''
|
||||||
|
|
||||||
// The following boolean should come undefined if it is rendering an unpaired machine
|
// 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)
|
return attribute ? R.prop(code, attribute) : 'Unpaired machine'
|
||||||
? R.compose(R.prop(code), findAttribute)(data)
|
|
||||||
: 'Unpaired machine'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const displayCodeArray = data => it => {
|
const displayCodeArray = data => it => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue