Make tag matching an AND operation

This commit is contained in:
Girish Ramakrishnan
2019-05-17 13:01:23 -07:00
parent c02eced029
commit 7adde2a880
+6 -3
View File
@@ -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;
});
};
});