this repo has no description
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

bug: fix top stats

+27 -4
+27 -4
public/app.js
··· 1 1 document.addEventListener("DOMContentLoaded", () => { 2 2 // Elements 3 3 const storyList = document.getElementById("story-list"); 4 - const totalAlertsEl = document.getElementById("total-alerts"); 5 - const avgPeakPointsEl = document.getElementById("avg-peak-points"); 6 - const verifiedCountEl = document.getElementById("verified-count"); 7 4 const refreshButton = document.getElementById("refresh-data"); 8 5 const noGraph = document.getElementById("no-graph"); 9 6 const rankChart = document.getElementById("rank-chart"); ··· 131 128 .then((response) => response.json()) 132 129 .then((data) => { 133 130 verifiedUserStats = data; 134 - updateTopRowStats(); // Update UI with the new stats 131 + // Update top row stats with the new data 132 + updateTopStats(data); 135 133 }) 136 134 .catch((error) => { 137 135 console.error("Error fetching verified user stats:", error); ··· 599 597 } 600 598 601 599 // Live counter function to update time-based elements 600 + // Update top row stats based on verified user data 601 + function updateTopStats(data) { 602 + // Update performance metrics if they exist 603 + const topTenCountEl = document.getElementById("top-ten-count"); 604 + const mostActiveTimeEl = document.getElementById("most-active-time"); 605 + 606 + if (topTenCountEl) { 607 + topTenCountEl.textContent = data.frontPageCount || "0"; 608 + } 609 + if (mostActiveTimeEl) { 610 + mostActiveTimeEl.textContent = data.avgPeakPoints || "0"; 611 + } 612 + 613 + // Update verified user analytics metrics if they exist 614 + const verifiedUserCountEl = document.getElementById("verified-user-count"); 615 + const verifiedAvgPointsEl = document.getElementById("verified-avg-points"); 616 + 617 + if (verifiedUserCountEl) { 618 + verifiedUserCountEl.textContent = data.totalCount || "0"; 619 + } 620 + if (verifiedAvgPointsEl) { 621 + verifiedAvgPointsEl.textContent = data.avgPeakPoints || "0"; 622 + } 623 + } 624 + 602 625 function updateLiveCounters() { 603 626 // Update current time 604 627 now = Date.now();