Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/hooks/usePath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions src/pages/home/Obj.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion src/pages/share/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1307,7 +1313,8 @@ const SharePage = () => {
objStore.state === State.Folder &&
!nodeLoading() &&
!infoLoading() &&
!nodeError()
!nodeError() &&
pagination.type !== "all"
}
>
<SharePager
Expand Down
3 changes: 1 addition & 2 deletions src/store/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ export const getPagination = (): {
Math.max(1, getSettingNumber("default_page_size", DEFAULT_PAGE_SIZE)),
)
return {
// `all` would trigger very large payloads; fallback to pagination.
type: rawType === "all" ? "pagination" : rawType,
type: rawType,
size,
}
}
Expand Down