From 014ee3187befa27d2a74ac0b9d88235188e74e78 Mon Sep 17 00:00:00 2001 From: Eric Berry Date: Fri, 22 Jun 2018 14:41:59 -0600 Subject: [PATCH] Ensure CodeFund request is only made if the Property ID is provided Also updated README with CodeFund instructions and link --- README.md | 4 ++++ assets/javascripts/discourse/components/codefund-ad.js.es6 | 2 ++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index a8fdaa5..690ce82 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ This is the official Discourse advertising plugin. It allows advertisements to * [Google Adsense](http://www.google.com.au/adsense/start/why-adsense.html) * [Google Double Click for Publishers](https://www.google.com/dfp) * [Amazon Affiliates](http://affiliate-program.amazon.com) - Banner and Product Link Ads +* [CodeFund](https://codefund.io) - Ethical Ad Platform for Developers ## Quick Start in 3 Steps @@ -58,6 +59,7 @@ There are 2 easy steps for configuring your Discourse settings to enable adverti @@ -82,7 +84,9 @@ Only for Product Link and Banner Ads. ![](https://www.dropbox.com/sc/l67fb5c3tl8bq3d/AAAAMmccMW3kkIeBR7cBdWoFa?dl=1) +##### CodeFund Embed Tag to Discourse's Site Settings +![CodeFund Instructions](https://s3-us-west-2.amazonaws.com/codesponsor/discourse-codefund-instructions.png) ### Step 3 - See Your Ad diff --git a/assets/javascripts/discourse/components/codefund-ad.js.es6 b/assets/javascripts/discourse/components/codefund-ad.js.es6 index 46e985a..01baeeb 100644 --- a/assets/javascripts/discourse/components/codefund-ad.js.es6 +++ b/assets/javascripts/discourse/components/codefund-ad.js.es6 @@ -49,6 +49,8 @@ export default Ember.Component.extend({ adDetails: {}, _triggerAds() { + if (!propertyId) return; + this.set('adRequested', true); loadCodeFund().then((data) => { _loaded = false;