0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 06:32:39 +00:00

Merge branch 'master' into addSortType&DirToLocalStorage-#2326

This commit is contained in:
Trevor Buckner
2022-09-03 23:11:13 -04:00
committed by GitHub
2 changed files with 33 additions and 41 deletions

View File

@@ -196,11 +196,16 @@ const ListPage = createClass({
getSortedBrews : function(brews){
const testString = _.deburr(this.state.filterString).toLowerCase();
brews = _.filter(brews, (brew)=>{
return (_.deburr(brew.title).toLowerCase().includes(testString)) ||
(_.deburr(brew.description).toLowerCase().includes(testString));
});
brews = _.filter(brews, (brew)=>{
const brewStrings = _.deburr([
brew.title,
brew.description,
brew.tags].join('\n')
.toLowerCase());
return brewStrings.includes(testString);
});
return _.orderBy(brews, (brew)=>{ return this.sortBrewOrder(brew); }, this.state.sortDir);
},