From 998df2bb29def8ae14b4e6834dee977b26c620ea Mon Sep 17 00:00:00 2001 From: Amelia <77553571+Fesaa@users.noreply.github.com> Date: Thu, 15 Jan 2026 21:30:49 +0100 Subject: [PATCH] Manually pre sort - Fixes #4365 --- .../file-breakdown-stats/file-breakdown-stats.component.html | 1 - .../file-breakdown-stats/file-breakdown-stats.component.ts | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/UI/Web/src/app/statistics/_components/file-breakdown-stats/file-breakdown-stats.component.html b/UI/Web/src/app/statistics/_components/file-breakdown-stats/file-breakdown-stats.component.html index 9446a81c4..23d07b654 100644 --- a/UI/Web/src/app/statistics/_components/file-breakdown-stats/file-breakdown-stats.component.html +++ b/UI/Web/src/app/statistics/_components/file-breakdown-stats/file-breakdown-stats.component.html @@ -13,7 +13,6 @@ [columnMode]="'force'" rowHeight="auto" [footerHeight]="50" - [sorts]="[{prop: 'totalFiles', dir: 'desc'}]" > diff --git a/UI/Web/src/app/statistics/_components/file-breakdown-stats/file-breakdown-stats.component.ts b/UI/Web/src/app/statistics/_components/file-breakdown-stats/file-breakdown-stats.component.ts index f0b517a36..b91a97945 100644 --- a/UI/Web/src/app/statistics/_components/file-breakdown-stats/file-breakdown-stats.component.ts +++ b/UI/Web/src/app/statistics/_components/file-breakdown-stats/file-breakdown-stats.component.ts @@ -37,7 +37,8 @@ export class FileBreakdownStatsComponent implements OnInit { ngOnInit() { this.statService.getFileBreakdown().pipe( tap(res => { - this.files.set(res.fileBreakdown); + // Using sort props breaks the table for some users; https://github.com/Kareadita/Kavita/issues/4365 + this.files.set(res.fileBreakdown.sort((a, b) => b.totalFiles - a.totalFiles)); this.totalSize.set(res.totalFileSize); }) ).subscribe();