simplified code across the app and consolidated duplicated helpers

This commit is contained in:
2026-09-27 17:29:54 +02:00
parent 3e856d0b1c
commit ee1240f71a
155 changed files with 1772 additions and 2546 deletions
+6 -4
View File
@@ -237,9 +237,7 @@ class DownloadManager {
// instead of freezing at the last percent.
job.status.value = const DownloadCancelled();
}
_jobs.remove(job.remotePath);
if (taskId != null) _byTaskId.remove(taskId);
scheduleMicrotask(job.dispose);
_forget(job);
}
_refreshVisible();
}
@@ -330,10 +328,14 @@ class DownloadManager {
// --- bookkeeping -----------------------------------------------------------
void _remove(DownloadJob job) {
_forget(job);
_refreshVisible();
}
void _forget(DownloadJob job) {
_jobs.remove(job.remotePath);
final taskId = job.taskId;
if (taskId != null) _byTaskId.remove(taskId);
_refreshVisible();
scheduleMicrotask(job.dispose);
}