FIX: Ensure we won't render the connector if there are no ads (#148)

This commit is contained in:
Roman Rizzi 2022-07-14 15:58:29 -03:00 committed by GitHub
parent d9b739f803
commit 4940d0ea19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -99,8 +99,8 @@ export function slotContenders(
site,
siteSettings,
placement,
postNumber,
indexNumber
indexNumber,
postNumber
) {
let types = [];
const houseAds = site.get("house_creatives"),
@ -186,8 +186,8 @@ export default AdComponent.extend({
this.site,
this.siteSettings,
placement,
postNumber,
indexNumber
indexNumber,
postNumber
);
},

View File

@ -3,12 +3,13 @@ import { slotContenders } from "discourse/plugins/discourse-adplugin/discourse/c
export default {
shouldRender(args, component) {
return (
args.index &&
slotContenders(
component.site,
component.siteSettings,
"topic-list-between",
args.index
).length === 0
).length > 0
);
},
};