AURORA-1843: свод 2 — догрузка строк страницами, поиск и фильтры через сервер (2/3, фронт) #243

Open
aep wants to merge 14 commits from feat/236-aurora-1843-svod2-server-paging-web into feat/236-aurora-1843-svod2-server-paging
Showing only changes of commit 900a3c6535 - Show all commits

View File

@ -31,7 +31,7 @@ export function getWindowPages(visiblePage, total) {
export function getWindowRange(pages, total) {
if (pages.length === 0) return { windowStart: 0, windowEnd: 0 };
const first = pages[0];
const last = pages[pages.length - 1];
const last = pages.at(-1);
return { windowStart: first * PAGE_SIZE, windowEnd: Math.min(total, (last + 1) * PAGE_SIZE) };
}