Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
rezkiy37 committed Sep 13, 2023
1 parent ea2307f commit 68727ae
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/components/OptionsList/BaseOptionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,17 @@ function BaseOptionsList({
*/
const renderItem = ({item, index, section}) => {
const isItemDisabled = isDisabled || section.isDisabled || !!item.isDisabled;
const isSelected = Boolean(
_.find(selectedOptions, (option) => {
if (option.accountID === item.accountID) {
return true;
}
const isSelected = _.some(selectedOptions, (option) => {
if (option.accountID === item.accountID) {
return true;
}

if (_.isEmpty(option.name)) {
return false;
}
if (_.isEmpty(option.name)) {
return false;
}

return option.name === item.searchText;
}),
);
return option.name === item.searchText;
});

return (
<OptionRow
Expand Down

0 comments on commit 68727ae

Please sign in to comment.