Fix compatibility with other js tests

This commit is contained in:
Neil Lalonde 2019-05-03 13:26:16 -04:00
parent 171656304b
commit 26d42e9ed7
2 changed files with 14 additions and 4 deletions

View File

@ -47,8 +47,13 @@ export default Ember.Component.extend({
@computed("placement") @computed("placement")
adComponents(placement) { adComponents(placement) {
// Check house ads first // Check house ads first
const houseAds = this.site.get("house_creatives"), const houseAds = this.site.get("house_creatives");
adsForSlot = houseAds.settings[placement.replace(/-/g, "_")]; if (!houseAds || !houseAds.settings) {
return [];
}
const adsForSlot = houseAds.settings[placement.replace(/-/g, "_")];
if ( if (
Object.keys(houseAds.creatives).length > 0 && Object.keys(houseAds.creatives).length > 0 &&
!Ember.isBlank(adsForSlot) !Ember.isBlank(adsForSlot)

View File

@ -56,8 +56,13 @@ export default AdComponent.extend({
}, },
adsNamesForSlot(placement) { adsNamesForSlot(placement) {
const houseAds = this.site.get("house_creatives"), const houseAds = this.site.get("house_creatives");
adsForSlot = houseAds.settings[placement];
if (!houseAds || !houseAds.settings) {
return [];
}
const adsForSlot = houseAds.settings[placement];
if ( if (
Object.keys(houseAds.creatives).length > 0 && Object.keys(houseAds.creatives).length > 0 &&