0%
e = document.querySelector('.post-title').innerText.trim(); var doc = articles.doc(title); var increaseCount = CONFIG.hostname === location.hostname; if (localStorage.getItem(title)) { increaseCount = false; } else { // Mark as visited localStorage.setItem(title, true); } getCount(doc, increaseCount).then(appendCountTo(document.querySelector('.firestore-visitors-count'))); } else if (CONFIG.page.isHome) { // Is index page var promises = [...document.querySelectorAll('.post-title')].map(element => { var title = element.innerText.trim(); var doc = articles.doc(title); return getCount(doc); }); Promise.all(promises).then(counts => { var metas = document.querySelectorAll('.firestore-visitors-count'); counts.forEach((val, idx) => { appendCountTo(metas[idx])(val); }); }); } })();