Manually pre sort - Fixes #4365

This commit is contained in:
Amelia 2026-01-15 21:30:49 +01:00
parent 77486350ef
commit 998df2bb29
No known key found for this signature in database
GPG Key ID: 44DBD99C9CCFD079
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,6 @@
[columnMode]="'force'"
rowHeight="auto"
[footerHeight]="50"
[sorts]="[{prop: 'totalFiles', dir: 'desc'}]"
>
<ngx-datatable-column prop="extension" [sortable]="true" [draggable]="false" [resizeable]="false">
<ng-template ngx-datatable-header-template>

View File

@ -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();