From 721952a6796d13395f47bc45f965e03e6d70a871 Mon Sep 17 00:00:00 2001 From: Muppetteer Date: Sat, 29 Nov 2025 03:31:01 +1100 Subject: [PATCH] Maintain book selections when switching between table and grid views (#1651) --- .../book/components/book-browser/book-browser.component.html | 1 + .../components/book-browser/book-table/book-table.component.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.html b/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.html index efc786d76..991502a04 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.html +++ b/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.html @@ -242,6 +242,7 @@ @if (currentViewMode === 'table' && books.length > 0) { (); protected urlHelper = inject(UrlHelperService); private bookService = inject(BookService); @@ -89,6 +90,8 @@ export class BookTableComponent implements OnInit, OnDestroy, OnChanges { this.metadataCenterViewMode = userState?.user?.userSettings.metadataCenterViewMode ?? 'route'; }); + this.selectedBookIds = this.preselectedBookIds; + this.selectedBooks = this.bookService.getBooksByIdsFromState([...this.selectedBookIds]); this.setScrollHeight(); window.addEventListener('resize', this.setScrollHeight.bind(this)); }