mirror of
https://github.com/discourse/discourse-adplugin.git
synced 2025-02-18 17:34:55 +00:00
Revert "FIX: removes part of the 2.4 legacy code forgotten (#87)"
This reverts commit c27d5f8e859cb80fda997db3ce2be2f0d0ce345f.
This commit is contained in:
parent
c27d5f8e85
commit
db4f5f990d
@ -51,10 +51,19 @@ export default Ember.Component.extend({
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let noAdsGroups = this.siteSettings.no_ads_for_groups
|
let noAdsGroups = this.siteSettings.no_ads_for_groups.split("|");
|
||||||
.split("|")
|
|
||||||
.filter(Boolean);
|
// TODO: Remove when 2.4 becomes the new stable. This is for backwards compatibility.
|
||||||
let currentGroups = groups.map(g => g.id.toString());
|
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));
|
return !currentGroups.any(g => noAdsGroups.includes(g));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user