fix(downloads): harden duplicate resolution and row controls

This commit is contained in:
NimBold
2026-07-29 18:28:46 +03:30
parent 546be23c91
commit 29bbb009b5
17 changed files with 248 additions and 89 deletions
+6 -2
View File
@@ -941,8 +941,12 @@ export const useDownloadStore = create<DownloadState>((set, get) => {
get().updateDownload(id, { hasBeenDispatched: true });
return true;
} else {
console.error("Failed to re-enqueue for resume");
get().updateDownload(id, { status: prevStatus });
const dispatchError = get().downloads.find(download => download.id === id)?.lastError;
console.error("Failed to re-enqueue for resume:", dispatchError || "backend rejected the enqueue request");
get().updateDownload(id, {
status: prevStatus,
...(dispatchError ? { lastError: dispatchError } : {})
});
clearDownloadControlIntent(id, 'resume');
return false;
}