This commit is contained in:
Christopher Cookman 2024-12-16 20:35:15 -07:00
parent f775bf96da
commit 6f3ff88eae

View file

@ -34,13 +34,13 @@ $("#signin").on("click", function () {
});
// Pull analytics from /api/analytics
var lastText = "";
setInterval(() => {
fetch('/api/analytics')
.then(response => response.json())
.then(data => {
estCallsMadeStat = data.total.find(stat => stat.tag === "estCallsMade")?.count;
currentDailyCallsMadeStat = data.daily.find(stat => stat.tag === "dailyCallsMade" && stat.current === true)?.count;
var lastText = "";
var newText = `Total calls made: ${estCallsMadeStat}<br>Today's calls made: ${currentDailyCallsMadeStat}`;
if (lastText !== newText) {
chgtext(newText);