Make Category & Channel pages re-fill ads after scrolling every 2 pages
This commit is contained in:
parent
327a574982
commit
4ae3fe7ea0
2 changed files with 19 additions and 2 deletions
|
@ -166,7 +166,13 @@ function ChannelContent(props: Props) {
|
|||
infiniteScroll={defaultInfiniteScroll}
|
||||
injectedItem={
|
||||
!hasPremiumPlus && {
|
||||
node: <Ads small type="video" tileLayout />,
|
||||
node: (index, lastVisibleIndex, pageSize) => {
|
||||
if (pageSize && index < pageSize) {
|
||||
return index === lastVisibleIndex ? <Ads type="video" tileLayout={tileLayout} small /> : null;
|
||||
} else {
|
||||
return index % (pageSize * 2) === 0 ? <Ads type="video" tileLayout={tileLayout} small /> : null;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
meta={
|
||||
|
|
|
@ -223,7 +223,18 @@ function DiscoverPage(props: Props) {
|
|||
tags={tags}
|
||||
hiddenNsfwMessage={<HiddenNsfw type="page" />}
|
||||
repostedClaimId={repostedClaim ? repostedClaim.claim_id : null}
|
||||
injectedItem={!isWildWest && !hasPremiumPlus && { node: <Ads small type="video" tileLayout /> }}
|
||||
injectedItem={
|
||||
!isWildWest &&
|
||||
!hasPremiumPlus && {
|
||||
node: (index, lastVisibleIndex, pageSize) => {
|
||||
if (pageSize && index < pageSize) {
|
||||
return index === lastVisibleIndex ? <Ads small type="video" tileLayout={tileLayout} /> : null;
|
||||
} else {
|
||||
return index % (pageSize * 2) === 0 ? <Ads small type="video" tileLayout={tileLayout} /> : null;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
// TODO: find a better way to determine discover / wild west vs other modes release times
|
||||
// for now including && !tags so that
|
||||
releaseTime={releaseTime || undefined}
|
||||
|
|
Loading…
Reference in a new issue