Files
Roman Rizzi d9b739f803 FIX: Don't render the connector when we shouldn't display an ad in the topic list item. (#146)
We expose the ad-slot logic to determine which ads are potentially available for each slot and don't render the connector when there are none. Leaking the component logic is not ideal, but I don't see a better solution given the
current design.
2022-07-12 16:13:18 -03:00

16 lines
372 B
JavaScript

export function isNthPost(every, currentPostNumber) {
if (every && every > 0) {
return currentPostNumber % every === 0;
} else {
return false;
}
}
export function isNthTopicListItem(every, currentIndexPosition) {
if (every && every > 0 && currentIndexPosition > 0) {
return (currentIndexPosition + 1) % every === 0;
} else {
return false;
}
}