From 06a96ef2d155f48376908c8964aacd5a3cfc0f75 Mon Sep 17 00:00:00 2001 From: "servarr[bot]" <68984020+servarr[bot]@users.noreply.github.com> Date: Sun, 21 Jan 2024 03:44:01 +0200 Subject: [PATCH] Fixed: Movies poster view on mobile devices (#9659) (cherry picked from commit c0b30a50281c38a103c2f800064d0ec964fae6e0) Co-authored-by: Mark McDowall --- .../src/Movie/Index/Posters/MovieIndexPosters.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/Movie/Index/Posters/MovieIndexPosters.tsx b/frontend/src/Movie/Index/Posters/MovieIndexPosters.tsx index 56b60b438..5e9b878d1 100644 --- a/frontend/src/Movie/Index/Posters/MovieIndexPosters.tsx +++ b/frontend/src/Movie/Index/Posters/MovieIndexPosters.tsx @@ -244,11 +244,15 @@ export default function MovieIndexPosters(props: MovieIndexPostersProps) { if (isSmallScreen) { const padding = bodyPaddingSmallScreen - 5; + const width = window.innerWidth - padding * 2; + const height = window.innerHeight; - setSize({ - width: window.innerWidth - padding * 2, - height: window.innerHeight, - }); + if (width !== size.width || height !== size.height) { + setSize({ + width, + height, + }); + } return; }