Fix set card size index on mount

This commit is contained in:
advplyr 2021-08-26 10:43:46 -05:00
parent b4a62dbf4b
commit 64cc7efa6a
3 changed files with 7 additions and 3 deletions

View File

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

View File

@ -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": {

View File

@ -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": {