mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
addressed code rabbit
This commit is contained in:
@@ -27,7 +27,9 @@
|
||||
|
||||
if (url.searchParams.has(pageParam)) {
|
||||
const page = Number(url.searchParams.get(pageParam));
|
||||
const newPage = Math.floor(((page - 1) * previousLimit) / limit);
|
||||
const prev =
|
||||
Number.isFinite(previousLimit) && previousLimit > 0 ? previousLimit : limit;
|
||||
const newPage = Math.floor(((page - 1) * prev) / limit) + 1;
|
||||
const safePage = Math.max(1, Number.isFinite(newPage) ? newPage : 1);
|
||||
if (removeOnFirstPage && safePage === 1) {
|
||||
url.searchParams.delete(pageParam);
|
||||
|
||||
Reference in New Issue
Block a user