Compare commits

..

2 Commits

Author SHA1 Message Date
Administrator
d159ac484a release: v3.3.51 2026-06-08 19:22:54 +02:00
Administrator
f4b5fadc5f fix(ui): first click on sort header sets default direction instead of toggling 2026-06-08 19:22:29 +02:00
2 changed files with 17 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "multi-hoster-uploader", "name": "multi-hoster-uploader",
"version": "3.3.50", "version": "3.3.51",
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously", "description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {

View File

@ -63,10 +63,12 @@ const queueSortState = { key: 'filename', direction: 'asc' };
// History state // History state
let historyRowsData = []; let historyRowsData = [];
let historySortState = { key: 'date', direction: 'desc' }; let historySortState = { key: 'date', direction: 'desc' };
let _historySortClicked = false;
// Session-specific files for the "Files" panel (resets each session) // Session-specific files for the "Files" panel (resets each session)
let sessionFilesData = []; let sessionFilesData = [];
const recentSortState = { key: 'date', direction: 'desc' }; const recentSortState = { key: 'date', direction: 'desc' };
let _recentSortClicked = false;
const selectedRecentIds = new Set(); const selectedRecentIds = new Set();
// Maintained incrementally — avoids O(n) filter() scans every 250ms in the status bar. // Maintained incrementally — avoids O(n) filter() scans every 250ms in the status bar.
let _sessionDoneCount = 0; let _sessionDoneCount = 0;
@ -4150,8 +4152,14 @@ function renderHistoryTable(container) {
const th = e.target.closest('th.sortable'); const th = e.target.closest('th.sortable');
if (th && container.contains(th)) { if (th && container.contains(th)) {
const key = th.dataset.historySort; const key = th.dataset.historySort;
if (historySortState.key === key) historySortState.direction = historySortState.direction === 'asc' ? 'desc' : 'asc'; const defaultDir = key === 'date' ? 'desc' : 'asc';
else { historySortState.key = key; historySortState.direction = key === 'date' ? 'desc' : 'asc'; } if (!_historySortClicked || historySortState.key !== key) {
_historySortClicked = true;
historySortState.key = key;
historySortState.direction = defaultDir;
} else {
historySortState.direction = historySortState.direction === 'asc' ? 'desc' : 'asc';
}
renderHistoryTable(container); renderHistoryTable(container);
return; return;
} }
@ -4207,11 +4215,13 @@ function setupListeners() {
const th = e.target.closest('th[data-recent-sort]'); const th = e.target.closest('th[data-recent-sort]');
if (!th) return; if (!th) return;
const key = th.dataset.recentSort; const key = th.dataset.recentSort;
if (recentSortState.key === key) { const defaultDir = key === 'date' ? 'desc' : 'asc';
recentSortState.direction = recentSortState.direction === 'desc' ? 'asc' : 'desc'; if (!_recentSortClicked || recentSortState.key !== key) {
} else { _recentSortClicked = true;
recentSortState.key = key; recentSortState.key = key;
recentSortState.direction = key === 'date' ? 'desc' : 'asc'; recentSortState.direction = defaultDir;
} else {
recentSortState.direction = recentSortState.direction === 'desc' ? 'asc' : 'desc';
} }
renderRecentUploadsPanel(); renderRecentUploadsPanel();
}); });