From 8c9fb0d45e4b40f426c9a7ff7baa3b5cb99ea45c Mon Sep 17 00:00:00 2001 From: Mark Cooper Date: Thu, 26 Aug 2021 10:43:46 -0500 Subject: [PATCH] Fix set card size index on mount --- client/components/app/BookShelf.vue | 6 +++++- client/package.json | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/components/app/BookShelf.vue b/client/components/app/BookShelf.vue index dc1fb42c..c6bada15 100644 --- a/client/components/app/BookShelf.vue +++ b/client/components/app/BookShelf.vue @@ -102,6 +102,8 @@ export default { this.width = Math.max(0, this.width - this.rowPaddingX * 2) var booksPerRow = Math.floor(this.width / this.bookWidth) this.booksPerRow = booksPerRow + console.warn('this.selectedSizeIndex', this.selectedSizeIndex, 'Book Cover Size', this.bookCoverWidth) + console.warn('Books Per Row', this.booksPerRow, 'Width', this.width, 'Book Width', this.bookWidth) }, getAudiobookCard(id) { if (this.$refs[`audiobookCard-${id}`] && this.$refs[`audiobookCard-${id}`].length) { @@ -110,7 +112,9 @@ export default { return null }, init() { - this.selectedSizeIndex = this.$store.getters['user/getUserSetting']('bookshelfCoverSize') + var bookshelfCoverSize = this.$store.getters['user/getUserSetting']('bookshelfCoverSize') + var sizeIndex = this.availableSizes.findIndex((s) => s === bookshelfCoverSize) + if (!isNaN(sizeIndex)) this.selectedSizeIndex = sizeIndex this.calculateBookshelf() }, resize() { diff --git a/client/package.json b/client/package.json index 9da0f0be..b0140445 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf-client", - "version": "0.9.82-beta", + "version": "0.9.83-beta", "description": "Audiobook manager and player", "main": "index.js", "scripts": { diff --git a/package.json b/package.json index c31871ba..76c994ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf", - "version": "0.9.82-beta", + "version": "0.9.83-beta", "description": "Self-hosted audiobook server for managing and playing audiobooks.", "main": "index.js", "scripts": {