Revert "FIX: removes part of the 2.4 legacy code forgotten (#87)"

This reverts commit c27d5f8e85.
This commit is contained in:
Penar Musaraj 2020-08-03 21:44:10 -04:00
parent c27d5f8e85
commit db4f5f990d
No known key found for this signature in database
GPG Key ID: E390435D881FF0F7
1 changed files with 13 additions and 4 deletions

View File

@ -51,10 +51,19 @@ export default Ember.Component.extend({
return true;
}
let noAdsGroups = this.siteSettings.no_ads_for_groups
.split("|")
.filter(Boolean);
let currentGroups = groups.map(g => g.id.toString());
let noAdsGroups = this.siteSettings.no_ads_for_groups.split("|");
// TODO: Remove when 2.4 becomes the new stable. This is for backwards compatibility.
const groupListUseIDs = this.site.group_list_use_ids;
let currentGroups = groups;
if (groupListUseIDs) {
currentGroups = currentGroups.map(g => g.id.toString());
} else {
currentGroups = currentGroups.map(g => g.name.toLowerCase());
noAdsGroups = noAdsGroups.map(g => g.toLowerCase());
}
return !currentGroups.any(g => noAdsGroups.includes(g));
},