perf: remove blocking archive counts from navigation

This commit is contained in:
ImBenji
2026-08-04 21:42:23 +01:00
parent 2020a0fde2
commit 002b7b320c
12 changed files with 87 additions and 82 deletions
+6 -3
View File
@@ -74,11 +74,14 @@ async function loadArticles() {
`).join("");
const total = data.total;
document.getElementById("pageInfo").textContent =
`${articleOffset + 1}${Math.min(articleOffset + PAGE, total)} of ${total.toLocaleString()}`;
const start = data.rows.length ? articleOffset + 1 : 0;
const end = articleOffset + data.rows.length;
document.getElementById("pageInfo").textContent = total == null
? `${start}${end} · filtered results`
: `${start}${end} of approximately ${total.toLocaleString()}`;
document.getElementById("prevBtn").disabled = articleOffset === 0;
document.getElementById("nextBtn").disabled = articleOffset + PAGE >= total;
document.getElementById("nextBtn").disabled = !data.hasMore;
}