Make tag matching an AND operation
This commit is contained in:
+6
-3
@@ -213,10 +213,13 @@ app.filter('selectedTagFilter', function () {
|
||||
return function selectedTagFilter(apps, selectedTags) {
|
||||
return apps.filter(function (app) {
|
||||
if (selectedTags.length === 0) return true;
|
||||
if (!app.tags) return false;
|
||||
|
||||
return !!selectedTags.find(function (tag) {
|
||||
return !app.tags ? false : (app.tags.indexOf(tag) !== -1);
|
||||
});
|
||||
for (var i = 0; i < selectedTags.length; i++) {
|
||||
if (app.tags.indexOf(selectedTags[i]) === -1) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user