diff --git a/ui/src/app/app.component.ts b/ui/src/app/app.component.ts index fba18ab..600dff6 100644 --- a/ui/src/app/app.component.ts +++ b/ui/src/app/app.component.ts @@ -185,19 +185,17 @@ export class AppComponent implements OnInit { get folderNavs(): { name: string; count: number }[] { const counts = new Map(); - const bump = (dl: Download) => { - const key = dl.folder || ''; + for (const { value } of this.statusEntries(this.status)) { + const key = value.folder || ''; counts.set(key, (counts.get(key) || 0) + 1); - }; - this.downloads.queue.forEach(bump); - this.downloads.done.forEach(bump); + } return Array.from(counts.entries()) .map(([name, count]) => ({ name, count })) .sort((a, b) => a.name.localeCompare(b.name, 'zh')); } get allCount(): number { - return this.downloads.queue.size + this.downloads.done.size; + return this.statusEntries(this.status).length; } get folderName(): string {