From 12bce48ef5f043b34c632f44ae10fc68c2b1ab15 Mon Sep 17 00:00:00 2001 From: advplyr Date: Wed, 18 Sep 2024 15:30:24 -0500 Subject: [PATCH] Update:Home page refetch items when scanning in first items --- client/components/app/BookShelfCategorized.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/components/app/BookShelfCategorized.vue b/client/components/app/BookShelfCategorized.vue index d7d850d5..a977dd21 100644 --- a/client/components/app/BookShelfCategorized.vue +++ b/client/components/app/BookShelfCategorized.vue @@ -347,6 +347,13 @@ export default { libraryItemsAdded(libraryItems) { console.log('libraryItems added', libraryItems) + // First items added to library + const isThisLibrary = libraryItems.some((li) => li.libraryId === this.currentLibraryId) + if (!this.shelves.length && !this.search && isThisLibrary) { + this.fetchCategories() + return + } + const recentlyAddedShelf = this.shelves.find((shelf) => shelf.id === 'recently-added') if (!recentlyAddedShelf) return