diff --git a/src/hooks/usePath.ts b/src/hooks/usePath.ts index d80b4684b9..9d8e59c2e6 100644 --- a/src/hooks/usePath.ts +++ b/src/hooks/usePath.ts @@ -71,6 +71,9 @@ export const usePath = () => { } const clampPerPage = (size?: number) => { + if (pagination.type === "all") { + return -1 + } const querySize = perPageFromQuery() const raw = typeof size === "number" && Number.isFinite(size) diff --git a/src/pages/home/Obj.tsx b/src/pages/home/Obj.tsx index 6ae93312a5..ec60c00a41 100644 --- a/src/pages/home/Obj.tsx +++ b/src/pages/home/Obj.tsx @@ -41,6 +41,9 @@ export const Obj = () => { : undefined }) const perPage = createMemo(() => { + if (pagination.type === "all") { + return -1 + } return pagination.type === "pagination" ? parseInt(searchParams["per_page"], 10) || pagination.size : undefined diff --git a/src/pages/share/index.tsx b/src/pages/share/index.tsx index 9f36b3bb78..b57775d592 100644 --- a/src/pages/share/index.tsx +++ b/src/pages/share/index.tsx @@ -708,10 +708,16 @@ const SharePage = () => { const currentToken = createMemo(() => shareToken()) const pagination = getPagination() const currentPage = createMemo(() => { + if (pagination.type === "all") { + return 1 + } const value = parseInt(searchParams["page"], 10) return Number.isFinite(value) && value > 0 ? value : 1 }) const currentPerPage = createMemo(() => { + if (pagination.type === "all") { + return -1 + } const value = parseInt(searchParams["per_page"], 10) if (Number.isFinite(value) && value > 0) { return Math.min(MAX_PAGE_SIZE, value) @@ -1307,7 +1313,8 @@ const SharePage = () => { objStore.state === State.Folder && !nodeLoading() && !infoLoading() && - !nodeError() + !nodeError() && + pagination.type !== "all" } >