From fcd9fb592d0ea8b0abfbe38af8713e771122d299 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 5 Oct 2020 21:15:49 -0700 Subject: [PATCH] Recalculate grid in overview view when changing options (cherry picked from commit d105dd47e02b9ed3616edf31d77623ca2ceb791e) Closes #1656 --- .../Index/Overview/ArtistIndexOverviewInfo.js | 1 - .../Artist/Index/Overview/ArtistIndexOverviews.js | 13 +++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/src/Artist/Index/Overview/ArtistIndexOverviewInfo.js b/frontend/src/Artist/Index/Overview/ArtistIndexOverviewInfo.js index 2c6604c89..f7cda7916 100644 --- a/frontend/src/Artist/Index/Overview/ArtistIndexOverviewInfo.js +++ b/frontend/src/Artist/Index/Overview/ArtistIndexOverviewInfo.js @@ -15,7 +15,6 @@ const rows = [ name: 'monitored', showProp: 'showMonitored', valueProp: 'monitored' - }, { name: 'qualityProfileId', diff --git a/frontend/src/Artist/Index/Overview/ArtistIndexOverviews.js b/frontend/src/Artist/Index/Overview/ArtistIndexOverviews.js index 7b865569e..101092170 100644 --- a/frontend/src/Artist/Index/Overview/ArtistIndexOverviews.js +++ b/frontend/src/Artist/Index/Overview/ArtistIndexOverviews.js @@ -73,7 +73,8 @@ class ArtistIndexOverviews extends Component { sortKey, overviewOptions, jumpToCharacter, - scrollTop + scrollTop, + isSmallScreen } = this.props; const { @@ -84,13 +85,17 @@ class ArtistIndexOverviews extends Component { if (prevProps.sortKey !== sortKey || prevProps.overviewOptions !== overviewOptions) { - this.calculateGrid(); + this.calculateGrid(this.state.width, isSmallScreen); } - if (this._grid && + if ( + this._grid && (prevState.width !== width || prevState.rowHeight !== rowHeight || - hasDifferentItemsOrOrder(prevProps.items, items))) { + hasDifferentItemsOrOrder(prevProps.items, items) || + prevProps.overviewOptions !== overviewOptions + ) + ) { // recomputeGridSize also forces Grid to discard its cache of rendered cells this._grid.recomputeGridSize(); }