mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-02 02:02:43 +00:00
Switch to better brew.tags array check
This commit is contained in:
@@ -219,8 +219,8 @@ const ListPage = createClass({
|
|||||||
// Filter by user selected tags
|
// Filter by user selected tags
|
||||||
let filterTagTest = true;
|
let filterTagTest = true;
|
||||||
if(this.state.filterTags.length > 0){
|
if(this.state.filterTags.length > 0){
|
||||||
filterTagTest = this.state.filterTags.every((tag)=>{
|
filterTagTest = this.state.filterTags?.every((tag)=>{
|
||||||
if(typeof brew.tags == 'string') return false;
|
if(!Array.isArray(brew.tags)) return false;
|
||||||
return brew.tags.findIndex((brewTag)=>{
|
return brew.tags.findIndex((brewTag)=>{
|
||||||
return brewTag.toLowerCase() == tag.toLowerCase();
|
return brewTag.toLowerCase() == tag.toLowerCase();
|
||||||
}) >= 0;
|
}) >= 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user