mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-09 18:59:36 +00:00
fix: resolve download state, toast UI, and checksum cleanup loopholes
- Prevent backward state transitions for downloads in frontend store. - Add Downloading event emission upon aria2 unpause. - Fix toast container visual bleed on exit by adding overflow-hidden. - Add retry backoff for deleted files to prevent Windows file lock errors. - Lowercase checksum hash types before passing to aria2. - Clean up lingering files upon checksum verification failure. - Convert Tauri AppHandle arguments to support generic runtimes.
This commit is contained in:
@@ -58,6 +58,13 @@ export async function initDownloadListener() {
|
||||
const current = mainStore.downloads.find(d => d.id === payload.id);
|
||||
if (current) {
|
||||
const status = payload.status as DownloadStatus;
|
||||
|
||||
// Prevent race condition: don't transition backwards from terminal state
|
||||
if ((current.status === 'completed' || current.status === 'failed') &&
|
||||
(status !== 'completed' && status !== 'failed')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const progress = useDownloadProgressStore.getState().progressMap[payload.id];
|
||||
const updates: Partial<DownloadItem> = {
|
||||
status,
|
||||
|
||||
Reference in New Issue
Block a user