Fix domain filter select

This commit is contained in:
Johannes Zellner
2019-05-20 23:40:02 +02:00
parent 9a859629bc
commit 765307ddef
3 changed files with 12 additions and 10 deletions
+5 -7
View File
@@ -225,15 +225,13 @@ app.filter('selectedTagFilter', function () {
});
app.filter('selectedDomainFilter', function () {
return function selectedDomainFilter(apps, selectedDomains) {
return function selectedDomainFilter(apps, selectedDomain) {
return apps.filter(function (app) {
if (selectedDomains.length === 0) return true;
if (!selectedDomain) return true;
if (selectedDomain._alldomains) return true; // magic domain for single select, see apps.js ALL_DOMAINS_DOMAIN
return !!selectedDomains.find(function (domain) {
if (app.domain === domain.domain) return true;
return !!app.alternateDomains.find(function (ad) { return ad.domain === domain.domain; });
});
if (selectedDomain.domain === app.domain) return true;
return !!app.alternateDomains.find(function (ad) { return ad.domain === selectedDomain.domain; });
});
};
});