0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-28 20:03:02 +00:00

Simplify filter tag test

This commit is contained in:
G.Ambatte
2023-12-04 07:54:19 +13:00
parent 7e98f79416
commit 2c997458b2

View File

@@ -219,8 +219,7 @@ const ListPage = createClass({
// Filter by user selected tags
let filterTagTest = true;
if(this.state.filterTags.length > 0){
filterTagTest = this.state.filterTags?.every((tag)=>{
if(!Array.isArray(brew.tags)) return false;
filterTagTest = Array.isArray(brew.tags) && this.state.filterTags?.every((tag)=>{
return brew.tags.findIndex((brewTag)=>{
return brewTag.toLowerCase() == tag.toLowerCase();
}) >= 0;