({ pane, folder, sourceId, requestedCursor })
| 2021 | } |
| 2022 | |
| 2023 | function resolveServerPagingCursorForLoad({ pane, folder, sourceId, requestedCursor }) { |
| 2024 | if (requestedCursor != null) { |
| 2025 | return String(requestedCursor); |
| 2026 | } |
| 2027 | if (window.viewMode !== 'table' || window.showInlineFolders === false) { |
| 2028 | return ''; |
| 2029 | } |
| 2030 | |
| 2031 | const paneKey = normalizePaneKey(pane); |
| 2032 | const state = getPaneState(paneKey); |
| 2033 | const pageRaw = Number(state?.currentPage || window.currentPage || 1); |
| 2034 | const targetPage = Number.isFinite(pageRaw) ? Math.max(1, Math.floor(pageRaw)) : 1; |
| 2035 | if (targetPage <= 1) { |
| 2036 | return ''; |
| 2037 | } |
| 2038 | |
| 2039 | const subfolders = getSubfoldersForPagingContext(paneKey, folder, sourceId); |
| 2040 | const totalFolders = Array.isArray(subfolders) ? subfolders.length : 0; |
| 2041 | if (totalFolders <= 0) { |
| 2042 | return ''; |
| 2043 | } |
| 2044 | const pageSize = getFileListCursorPageSize(); |
| 2045 | const fileOffset = Math.max(0, ((targetPage - 1) * pageSize) - totalFolders); |
| 2046 | return String(fileOffset); |
| 2047 | } |
| 2048 | |
| 2049 | let __frTreeSourceId = null; |
| 2050 |
no test coverage detected