Don't render inside a cloaked post
This commit is contained in:
parent
2ca0adca05
commit
d3a5927ede
|
@ -7,24 +7,28 @@ export default {
|
|||
withPluginApi("0.1", api => {
|
||||
api.decorateWidget("post:after", dec => {
|
||||
if (dec.canConnectComponent) {
|
||||
if (!dec.attrs.cloaked) {
|
||||
return dec.connect({
|
||||
component: "post-bottom-ad",
|
||||
context: "model"
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Old way for backwards compatibility
|
||||
return dec.connect({
|
||||
component: "post-bottom-ad",
|
||||
templateName: "connectors/post-bottom/discourse-adplugin",
|
||||
context: "model"
|
||||
});
|
||||
}
|
||||
|
||||
// Old way for backwards compatibility
|
||||
return dec.connect({
|
||||
templateName: "connectors/post-bottom/discourse-adplugin",
|
||||
context: "model"
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const messageBus = container.lookup('message-bus:main');
|
||||
if (!messageBus) { return; }
|
||||
const messageBus = container.lookup("message-bus:main");
|
||||
if (!messageBus) {
|
||||
return;
|
||||
}
|
||||
|
||||
messageBus.subscribe("/site/house-creatives", function (houseAdsSettings) {
|
||||
messageBus.subscribe("/site/house-creatives", function(houseAdsSettings) {
|
||||
Discourse.Site.currentProp("house_creatives", houseAdsSettings);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue