Skip to content

Project NOMAD is an offline-first knowledge and education server. Wikipedia, thousands of books, courses, maps, and optional local AI, all running on hardware you own with no internet required.

TypeScript

fix(Downloads): sort active downloads by progress descending

Chris Sherwoodc2b6e079afec
diff --git a/admin/app/services/download_service.ts b/admin/app/services/download_service.ts
index 276971ff..b5db2383 100644
--- a/admin/app/services/download_service.ts
+++ b/admin/app/services/download_service.ts
@@ -37,6 +37,9 @@ export class DownloadService {
const allDownloads = [...fileDownloads, ...modelDownloads]
// Filter by filetype if specified
- return allDownloads.filter((job) => !filetype || job.filetype === filetype)
+ const filtered = allDownloads.filter((job) => !filetype || job.filetype === filetype)
+
+ // Sort so actively downloading items (progress > 0) appear first, then by progress descending
+ return filtered.sort((a, b) => b.progress - a.progress)
}
}