Skip to content

Commit

Permalink
Remove ad overload on Browse page
Browse files Browse the repository at this point in the history
  • Loading branch information
edwh committed Feb 23, 2024
1 parent 0e1d439 commit 804792a
Showing 1 changed file with 1 addition and 84 deletions.
85 changes: 1 addition & 84 deletions components/MessageList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<MessageListCounts v-if="browseCount" @mark-seen="markSeen" />
</div>
<div
v-for="(message, ix) in deDuplicatedMessages"
v-for="message in deDuplicatedMessages"
:key="'messagelist-' + message.id"
>
<MessageListUpToDate
Expand Down Expand Up @@ -50,13 +50,6 @@
/>
</VisibleWhen>
</div>
<div v-if="insertAd(ix)" class="mt-3 mt-xl-2">
<ExternalDa
:ad-unit-path="insertAd(ix).adUnitPath"
:dimensions="insertAd(ix).dimensions"
:div-id="insertAd(ix).divId"
/>
</div>
</div>
</div>
<infinite-loading
Expand Down Expand Up @@ -515,82 +508,6 @@ export default {
}
}, 100)
},
insertAd(ix) {
// We show an ad occasionally in the feed.
if (ix % this.SHOW_AD_EVERY !== 0) {
return false
}
// We have to insert a different ad slot each time - Google doesn't let you repeat them. And we need to
// have different variants for desktop and mobile.
const desktop = !['xs', 'sm', 'md', 'lg'].includes(
this.miscStore.breakpoint
)
ix = ix / 10
const ads = desktop
? {
0: {
adUnitPath: '/22794232631/freegle_feed_desktop',
dimensions: [728, 90],
divId: 'div-gpt-ad-1692867153277-0',
},
1: {
adUnitPath: '/22794232631/freegle_feed_desktop_2',
dimensions: [728, 90],
divId: 'div-gpt-ad-1708280158016-0',
},
2: {
adUnitPath: '/22794232631/freegle_feed_desktop_3',
dimensions: [728, 90],
divId: 'div-gpt-ad-1708280229653-0',
},
3: {
adUnitPath: '/22794232631/freegle_feed_desktop_4',
dimensions: [728, 90],
divId: 'div-gpt-ad-1708280290737-0',
},
4: {
adUnitPath: '/22794232631/freegle_feed_desktop_5',
dimensions: [728, 90],
divId: 'div-gpt-ad-1708280362777-0',
},
}
: {
0: {
adUnitPath: '/22794232631/freegle_feed_app',
dimensions: [300, 250],
divId: 'div-gpt-ad-1692867324381-0',
},
1: {
adUnitPath: '/22794232631/freegle_feed_app_2',
dimensions: [300, 250],
divId: 'div-gpt-ad-1707999616879-0',
},
2: {
adUnitPath: '/22794232631/freegle_feed_app_3',
dimensions: [300, 250],
divId: 'div-gpt-ad-1707999845886-0',
},
3: {
adUnitPath: '/22794232631/freegle_feed_app_4',
dimensions: [300, 250],
divId: 'div-gpt-ad-1707999962593-0',
},
4: {
adUnitPath: '/22794232631/freegle_feed_app_5',
dimensions: [300, 250],
divId: 'div-gpt-ad-1708000097990-0',
},
}
if (ix < ads.length) {
return false
}
return ads[ix]
},
},
}
</script>

0 comments on commit 804792a

Please sign in to comment.