diff --git a/package.json b/package.json index 04da9d0..1df1430 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "multi-hoster-uploader", - "version": "3.3.101", + "version": "3.3.102", "description": "Upload files to doodstream, voe, vidmoly, byse simultaneously", "main": "main.js", "scripts": { diff --git a/renderer/app.js b/renderer/app.js index de05fe5..64bca40 100644 --- a/renderer/app.js +++ b/renderer/app.js @@ -4829,12 +4829,59 @@ function renderRecentUploadsPanel(appendOnly = false) { } const HISTORY_RENDER_CAP = 2000; +let _historyWorking = []; +let _historyLastRange = { start: -1, end: -1 }; +let _historyListenersBound = false; +let _historyScrollQueued = false; + +function _onHistoryScroll() { + if (_historyScrollQueued) return; + _historyScrollQueued = true; + requestAnimationFrame(() => { _historyScrollQueued = false; _renderHistoryVirtualRows(); }); +} + +function _renderHistoryVirtualRows() { + const container = document.getElementById('historyContainer'); + const tbody = document.getElementById('historyBody'); + if (!container || !tbody) return; + const total = _historyWorking.length; + const scrollTop = container.scrollTop; + const viewportHeight = Math.max(container.clientHeight, 600); + const startIdx = Math.max(0, Math.floor(scrollTop / VIRTUAL_ROW_HEIGHT) - VIRTUAL_OVERSCAN); + const endIdx = Math.min(total, Math.ceil((scrollTop + viewportHeight) / VIRTUAL_ROW_HEIGHT) + VIRTUAL_OVERSCAN); + if (startIdx === _historyLastRange.start && endIdx === _historyLastRange.end) return; + _historyLastRange = { start: startIdx, end: endIdx }; + const topPad = startIdx * VIRTUAL_ROW_HEIGHT; + const bottomPad = Math.max(0, (total - endIdx) * VIRTUAL_ROW_HEIGHT); + const parts = []; + if (topPad > 0) parts.push(`
Noch keine Uploads.
'; const emptyNotice = document.getElementById('historyCapNotice'); if (emptyNotice) emptyNotice.style.display = 'none'; + _historyWorking = []; return; } @@ -4850,50 +4897,22 @@ function renderHistoryTable(container) { } } - const rows = sortHistoryRows(working); + _historyWorking = sortHistoryRows(working); + _historyLastRange = { start: -1, end: -1 }; const headerCell = (key, label) => { const active = historySortState.key === key; const dir = active ? (historySortState.direction === 'asc' ? '▲' : '▼') : '↕'; return `