Compare commits

..

No commits in common. "a3b72d4cbf1e0ed3737991f61c8ccb12b7efcbfb" and "c7c6134d48cc2a37955f8d85f802b111e1e4183c" have entirely different histories.

2 changed files with 3 additions and 36 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "real-debrid-downloader", "name": "real-debrid-downloader",
"version": "1.7.25", "version": "1.7.24",
"description": "Desktop downloader", "description": "Desktop downloader",
"main": "build/main/main/main.js", "main": "build/main/main/main.js",
"author": "Sucukdeluxe", "author": "Sucukdeluxe",

View File

@ -3023,42 +3023,9 @@ export function App(): ReactElement {
const dragSelectRef = useRef(false); const dragSelectRef = useRef(false);
const dragAnchorRef = useRef<string | null>(null); const dragAnchorRef = useRef<string | null>(null);
const dragDidMoveRef = useRef(false); const dragDidMoveRef = useRef(false);
const lastClickedIdRef = useRef<string | null>(null);
// Flat list of all visible IDs (package headers + their visible items) in display order const onSelectId = useCallback((id: string, ctrlKey: boolean): void => {
const visibleOrderIds = useMemo(() => {
const ids: string[] = [];
for (const pkg of visiblePackages) {
ids.push(pkg.id);
if (!(collapsedPackages[pkg.id] ?? false)) {
const items = itemsByPackage.get(pkg.id) ?? [];
for (const item of items) {
if (snapshot.settings.hideExtractedItems && item.fullStatus?.startsWith("Entpackt")) continue;
ids.push(item.id);
}
}
}
return ids;
}, [visiblePackages, collapsedPackages, itemsByPackage, snapshot.settings.hideExtractedItems]);
const onSelectId = useCallback((id: string, ctrlKey: boolean, shiftKey: boolean): void => {
if (dragDidMoveRef.current) return; // drag handled it, skip click if (dragDidMoveRef.current) return; // drag handled it, skip click
if (shiftKey && lastClickedIdRef.current) {
const anchorIdx = visibleOrderIds.indexOf(lastClickedIdRef.current);
const targetIdx = visibleOrderIds.indexOf(id);
if (anchorIdx !== -1 && targetIdx !== -1) {
const from = Math.min(anchorIdx, targetIdx);
const to = Math.max(anchorIdx, targetIdx);
const rangeIds = visibleOrderIds.slice(from, to + 1);
setSelectedIds((prev) => {
const next = ctrlKey ? new Set(prev) : new Set<string>();
for (const rid of rangeIds) next.add(rid);
return next;
});
return;
}
}
lastClickedIdRef.current = id;
setSelectedIds((prev) => { setSelectedIds((prev) => {
if (ctrlKey) { if (ctrlKey) {
const next = new Set(prev); const next = new Set(prev);
@ -3068,7 +3035,7 @@ export function App(): ReactElement {
if (prev.size === 1 && prev.has(id)) return new Set(); if (prev.size === 1 && prev.has(id)) return new Set();
return new Set([id]); return new Set([id]);
}); });
}, [visibleOrderIds]); }, []);
const onSelectMouseDown = useCallback((id: string, e: React.MouseEvent): void => { const onSelectMouseDown = useCallback((id: string, e: React.MouseEvent): void => {
if (!e.ctrlKey || e.button !== 0) return; if (!e.ctrlKey || e.button !== 0) return;