From 3098e867cc5f5a79f65e9b46459d4c145a345361 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Wed, 5 Aug 2026 17:22:00 +0530 Subject: [PATCH] fix: resolve 4 bugs in leetcode-ranking --- frontend/js/boot.js | 2 +- frontend/js/leaderboard/compare.js | 2 ++ frontend/js/terminal_ui.js | 2 +- scripts/sync-leaderboard.js | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/js/boot.js b/frontend/js/boot.js index fcc2eff9..4cda3565 100644 --- a/frontend/js/boot.js +++ b/frontend/js/boot.js @@ -47,7 +47,7 @@ document.addEventListener("DOMContentLoaded", () => { text = text.replace("[OK]", '[OK]'); } - line.innerHTML = text; + line.textContent = text; bootInner.appendChild(line); // Auto scroll to bottom diff --git a/frontend/js/leaderboard/compare.js b/frontend/js/leaderboard/compare.js index cad75c17..3c25359a 100644 --- a/frontend/js/leaderboard/compare.js +++ b/frontend/js/leaderboard/compare.js @@ -847,3 +847,5 @@ function renderProgressHistoryChart() { }, }); } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file diff --git a/frontend/js/terminal_ui.js b/frontend/js/terminal_ui.js index 64d29fbd..957434eb 100644 --- a/frontend/js/terminal_ui.js +++ b/frontend/js/terminal_ui.js @@ -18,7 +18,7 @@ document.addEventListener("DOMContentLoaded", () => { titles.forEach((title) => { title.dataset.original = title.innerText.trim(); - title.innerText = ""; + title.textContent = ""; observer.observe(title); }); diff --git a/scripts/sync-leaderboard.js b/scripts/sync-leaderboard.js index ec9bb63a..84271ff4 100644 --- a/scripts/sync-leaderboard.js +++ b/scripts/sync-leaderboard.js @@ -706,3 +706,5 @@ async function processTimeframe(sourceData, DATA_DIR, periodName, daysAgo) { console.error(`Failed to write sync file: `, err.message); } })(); + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file