fix: remove extra idx and change map/any into some
This commit is contained in:
parent
1f94d95989
commit
4271d95a66
2 changed files with 1 additions and 7 deletions
|
|
@ -31,7 +31,6 @@ const Sidebar = ({
|
|||
className={classes.linkWrapper}
|
||||
onClick={() => onClick(it)}>
|
||||
<div
|
||||
key={idx}
|
||||
className={classnames({
|
||||
[classes.activeLink]: isSelected(it),
|
||||
[classes.customRenderActiveLink]: itemRender && isSelected(it),
|
||||
|
|
|
|||
|
|
@ -39,12 +39,7 @@ const getValidationSchema = countryCodes =>
|
|||
.required('A phone number is required')
|
||||
.test('is-valid-number', 'That is not a valid phone number', value => {
|
||||
try {
|
||||
const validMap = R.map(it => {
|
||||
const number = parsePhoneNumberWithError(value, it)
|
||||
return number.isValid()
|
||||
}, countryCodes)
|
||||
|
||||
return R.any(it => it === true, validMap)
|
||||
return countryCodes.some(countryCode => parsePhoneNumberWithError(value, countryCode).isValid())
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue