Skip to content

Commit

Permalink
fix: adding optional chaining for counting loans method
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Bedon committed Oct 2, 2024
1 parent 74b621b commit e03918d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/Thanks/BadgesCustomization.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,23 +212,23 @@ export default {
let matches = true;
if (badge.category.themes) {
matches = matches && badge.category.themes.some(theme => loan.themes.includes(theme));
matches = matches && badge.category.themes.some(theme => loan?.themes?.includes(theme));
}
if (badge.category.tags) {
matches = matches && badge.category.tags.some(tag => loan.tags.includes(tag));
matches = matches && badge.category.tags.some(tag => loan?.tags?.includes(tag));
}
if (badge.category.gender) {
matches = matches && loan.gender === badge.category.gender;
matches = matches && loan?.gender === badge.category.gender;
}
if (badge.category.countryIsoCode) {
matches = matches && badge.category.countryIsoCode.includes(loan.geocode.country.isoCode);
matches = matches && badge.category.countryIsoCode.includes(loan?.geocode?.country?.isoCode);
}
if (badge.category.distributionModel) {
matches = matches && loan.distributionModel === badge.category.distributionModel;
matches = matches && loan?.distributionModel === badge.category.distributionModel;
}
if (matches) {
Expand Down

0 comments on commit e03918d

Please sign in to comment.