From 1ced6d8db3402ff57e758a7f78f1921a34f7c74d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Mon, 17 Jan 2022 18:30:26 +0100 Subject: [PATCH] Fix: Horizontal mode not working if count not specified --- dist/plex-meets-homeassistant.js | 9 ++++----- src/plex-meets-homeassistant.ts | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index 06f586e..0e74174 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -22384,11 +22384,10 @@ class PlexMeetsHomeAssistant extends HTMLElement { let itemsPerRow = this.data[this.config.libraryName].length; if (this.maxCount) { maxRenderedItems = this.maxCount; - itemsPerRow = maxRenderedItems; - if (this.maxRows) { - itemsPerRow = Math.ceil(maxRenderedItems / this.maxRows); - } - console.log(itemsPerRow); + } + itemsPerRow = maxRenderedItems; + if (this.maxRows) { + itemsPerRow = Math.ceil(maxRenderedItems / this.maxRows); } // eslint-disable-next-line consistent-return const searchValues = lodash.split(this.searchValue, ' '); diff --git a/src/plex-meets-homeassistant.ts b/src/plex-meets-homeassistant.ts index 7a8f45e..3d20b35 100644 --- a/src/plex-meets-homeassistant.ts +++ b/src/plex-meets-homeassistant.ts @@ -614,11 +614,10 @@ class PlexMeetsHomeAssistant extends HTMLElement { let itemsPerRow = this.data[this.config.libraryName].length; if (this.maxCount) { maxRenderedItems = this.maxCount; - itemsPerRow = maxRenderedItems; - if (this.maxRows) { - itemsPerRow = Math.ceil(maxRenderedItems / this.maxRows); - } - console.log(itemsPerRow); + } + itemsPerRow = maxRenderedItems; + if (this.maxRows) { + itemsPerRow = Math.ceil(maxRenderedItems / this.maxRows); } // eslint-disable-next-line consistent-return const searchValues = _.split(this.searchValue, ' ');