fix: remove extra idx and change map/any into some

This commit is contained in:
Rafael 2024-12-05 09:59:10 +00:00
parent 1f94d95989
commit 4271d95a66
2 changed files with 1 additions and 7 deletions

View file

@ -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),

View file

@ -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
}