Fix expensive re-creation of author and book lists due to improper trackBy usage

This commit is contained in:
aditya.chandel
2025-08-14 12:37:12 -06:00
committed by Aditya Chandel
parent 60f8442514
commit d0f8791b14
@@ -79,7 +79,7 @@
</div> </div>
<p class="text-lg"> <p class="text-lg">
@for (author of book?.metadata!.authors; track author; let isLast = $last) { @for (author of book?.metadata!.authors; track $index; let isLast = $last) {
<a class="hover:underline dark:text-blue-400 cursor-pointer" (click)="goToAuthorBooks(author)"> <a class="hover:underline dark:text-blue-400 cursor-pointer" (click)="goToAuthorBooks(author)">
{{ author }} {{ author }}
</a> </a>
@@ -513,7 +513,7 @@
[infiniteScrollDistance]="2" [infiniteScrollDistance]="2"
[infiniteScrollThrottle]="50" [infiniteScrollThrottle]="50"
[horizontal]="true"> [horizontal]="true">
@for (book of bookInSeries; track book) { @for (book of bookInSeries; track book.id) {
<div class="dashboard-scroller-card"> <div class="dashboard-scroller-card">
<app-book-card-lite-component [book]="book"></app-book-card-lite-component> <app-book-card-lite-component [book]="book"></app-book-card-lite-component>
</div> </div>
@@ -532,7 +532,7 @@
[infiniteScrollDistance]="2" [infiniteScrollDistance]="2"
[infiniteScrollThrottle]="50" [infiniteScrollThrottle]="50"
[horizontal]="true"> [horizontal]="true">
@for (book of recommendedBooks; track book) { @for (book of recommendedBooks; track book.book.id) {
<div class="dashboard-scroller-card"> <div class="dashboard-scroller-card">
<app-book-card-lite-component [book]="book.book"></app-book-card-lite-component> <app-book-card-lite-component [book]="book.book"></app-book-card-lite-component>
</div> </div>