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
|
// Pull analytics from /api/analytics
|
||||||
|
var lastText = "";
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
fetch('/api/analytics')
|
fetch('/api/analytics')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
estCallsMadeStat = data.total.find(stat => stat.tag === "estCallsMade")?.count;
|
estCallsMadeStat = data.total.find(stat => stat.tag === "estCallsMade")?.count;
|
||||||
currentDailyCallsMadeStat = data.daily.find(stat => stat.tag === "dailyCallsMade" && stat.current === true)?.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}`;
|
var newText = `Total calls made: ${estCallsMadeStat}<br>Today's calls made: ${currentDailyCallsMadeStat}`;
|
||||||
if (lastText !== newText) {
|
if (lastText !== newText) {
|
||||||
chgtext(newText);
|
chgtext(newText);
|
||||||
|
|
Loading…
Reference in a new issue