From e19dcf7558402aef90405b18a29afb2ab5cf1807 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 25 Oct 2024 23:06:20 +0800 Subject: [PATCH] Skip check aspect ratio if > 1 media --- src/components/media.jsx | 3 ++- src/components/status.jsx | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/media.jsx b/src/components/media.jsx index 15e8de01..fc92df69 100644 --- a/src/components/media.jsx +++ b/src/components/media.jsx @@ -74,6 +74,7 @@ function Media({ showCaption, allowLongerCaption, altIndex, + checkAspectRatio = true, onClick = () => {}, }) { let { @@ -354,7 +355,7 @@ function Media({ } // Check natural aspect ratio vs display aspect ratio - if ($media) { + if (checkAspectRatio && $media) { const { clientWidth, clientHeight, diff --git a/src/components/status.jsx b/src/components/status.jsx index 915464e8..2e8bf83f 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -2220,6 +2220,7 @@ function Status({ } : undefined } + checkAspectRatio={mediaAttachments.length === 1} /> ))}