fix(quota): cap per-page credentials to 14

This commit is contained in:
LTbinglingfeng
2026-01-05 00:00:22 +08:00
parent 916dd3ec26
commit 681fc3cee5

View File

@@ -24,6 +24,7 @@ type QuotaSetter<T> = (updater: QuotaUpdater<T>) => void;
type ViewMode = 'paged' | 'all';
const MAX_ITEMS_PER_PAGE = 14;
const MAX_SHOW_ALL_THRESHOLD = 30;
interface QuotaPaginationState<T> {
@@ -153,8 +154,8 @@ export function QuotaSection<TState extends QuotaStatusState, TData>({
if (effectiveViewMode === 'all') {
setPageSize(Math.max(1, filteredFiles.length));
} else {
// Paged mode: 3 rows * columns
setPageSize(columns * 3);
// Paged mode: 3 rows * columns, capped to avoid oversized pages.
setPageSize(Math.min(columns * 3, MAX_ITEMS_PER_PAGE));
}
}, [effectiveViewMode, columns, filteredFiles.length, setPageSize]);