From 660cbebbc4ab74f209b7271e826d3109ac404aba Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 4 Nov 2023 19:05:14 +0800 Subject: [PATCH] Move iOS check outside --- src/components/status.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/status.jsx b/src/components/status.jsx index 44eadf81..ba4d51b5 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -81,6 +81,10 @@ const visibilityText = { direct: 'Private mention', }; +const isIOS = + window.ontouchstart !== undefined && + /iPad|iPhone|iPod/.test(navigator.userAgent); + function Status({ statusID, status, @@ -809,9 +813,6 @@ function Status({ const showContextMenu = !isSizeLarge && !previewMode && !_deleted && !quoted; - const isIOS = - window.ontouchstart !== undefined && - /iPad|iPhone|iPod/.test(navigator.userAgent); // Only iOS/iPadOS browsers don't support contextmenu // Some comments report iPadOS might support contextmenu if a mouse is connected const bindLongPressContext = useLongPress(