Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions assets/js/current-projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ function updateProjectCardDisplayState(filterParams){
if(key !=='Search'){
let inUrl = value;
let inCard = projectCardObj[key];
if( ( inCard.filter(x => inUrl.includes(x)) ).length == 0 ){
if(!inUrl.every(x => inCard.includes(x))){
cardsToHideContainer.push([key,projectCard.id]);
}
else{
Expand Down Expand Up @@ -603,7 +603,10 @@ function updateProjectCardDisplayState(filterParams){
}
}
}
cardsToHideContainer.map(item => document.getElementById(`${item[1]}`).style.display = 'none');
if (cardsToHideContainer.length > 0){
cardsToHideContainer.map(item => document.getElementById(`${item[1]}`).style.display = 'none');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Since the issue instructions used .map() here, this isn't on you, but consider .forEach() instead.

cardsToHideContainer.forEach(item => document.getElementById(`${item[1]}`).style.display = 'none');

.map() is reserved for transformations that use the returned array. Here it's purely a side effect, which is what .forEach() is for.

It's non blocking, and you did follow the instructions well. Thanks for the contribution

break;
}
}
});
}
Expand Down