0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-25 16:12:37 +00:00

Switch to better brew.tags array check

This commit is contained in:
G.Ambatte
2023-12-03 17:46:55 +13:00
parent 995d1c63d8
commit 9e12ab71f8

View File

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