Skip to content

Commit

Permalink
Merge pull request bruin-tennis-consulting#136 from awest25/percentag…
Browse files Browse the repository at this point in the history
…eErrors

Fixed issues with ghost value and percentages
  • Loading branch information
Fredenck authored May 5, 2024
2 parents f1ddf5c + a3c65fb commit de73e30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/components/FilterList.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const FilterList = ({ pointsData, filterList, setFilterList, showPercent, showCo
const countFilteredPointsTotal = (key) => {
return pointsData.reduce((total, point) => {
// Check if the value attribute is not an empty string
if (point[key] !== '') {
if (point[key] !== '' && point[key] !== null) {
return total + 1; // Add 1 to the total if this point has a value specific to this category (key)
}
// Otherwise, just return the current total without adding anything
Expand Down Expand Up @@ -83,7 +83,7 @@ const FilterList = ({ pointsData, filterList, setFilterList, showPercent, showCo
<ul className={styles.filterValuesList} style={{ display: openKey === key ? 'block' : 'none' }}>
{/* { console.log(uniqueValues)} */}
{uniqueValues[key].map((value) => (
value !== '' && (
value !== '' && value !== null && (
<div className={styles.filterValueItem} key={value} style={{
cursor: 'pointer',
backgroundColor: isActiveFilter(key, value) ? '#8BB8E8' : ''
Expand Down

0 comments on commit de73e30

Please sign in to comment.