in apps-rendering/src/client/article.ts [227:249]
function insertEpic(): void {
const epicPlaceholder = document.getElementById('js-epic-placeholder');
if (epicPlaceholder) {
epicPlaceholder.innerHTML = '';
}
if (navigator.onLine && epicPlaceholder) {
Promise.all([userClient.isPremium(), acquisitionsClient.getEpics()])
.then(([isPremium, maybeEpic]) => {
if (!isPremium && maybeEpic.epic) {
const { title, body, firstButton, secondButton } =
maybeEpic.epic;
const epicProps = {
title,
body,
firstButton,
secondButton,
};
ReactDOM.render(h(EpicContent, epicProps), epicPlaceholder);
}
})
.catch((error) => console.error(error));
}
}