I'm dumb
This commit is contained in:
parent
f775bf96da
commit
6f3ff88eae
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue