FIX: ads always showing in all placements for CodeFund and Carbon Ads

FIX: ads always showing in all placements for CodeFund and Carbon Ads

Checkboxes used to choose which placements to have ads were not handled correctly.

diff --git a/assets/javascripts/discourse/components/ad-slot.js.es6 b/assets/javascripts/discourse/components/ad-slot.js.es6
index e4f1ab6..02d3261 100644
--- a/assets/javascripts/discourse/components/ad-slot.js.es6
+++ b/assets/javascripts/discourse/components/ad-slot.js.es6
@@ -117,7 +117,11 @@ export default AdComponent.extend({
           }${placeUnderscored}_code`;
         }
 
-        if (name !== false && !Ember.isBlank(this.siteSettings[name])) {
+        if (
+          name !== false &&
+          this.siteSettings[name] !== false &&
+          !Ember.isBlank(this.siteSettings[name])
+        ) {
           types.push(adNetwork);
         }
       }

GitHub sha: 71c51ebd

1 Like