Move iOS check outside

This commit is contained in:
Lim Chee Aun 2023-11-04 19:05:14 +08:00
parent f8674963b3
commit 660cbebbc4

View file

@ -81,6 +81,10 @@ const visibilityText = {
direct: 'Private mention', direct: 'Private mention',
}; };
const isIOS =
window.ontouchstart !== undefined &&
/iPad|iPhone|iPod/.test(navigator.userAgent);
function Status({ function Status({
statusID, statusID,
status, status,
@ -809,9 +813,6 @@ function Status({
const showContextMenu = !isSizeLarge && !previewMode && !_deleted && !quoted; 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 // Only iOS/iPadOS browsers don't support contextmenu
// Some comments report iPadOS might support contextmenu if a mouse is connected // Some comments report iPadOS might support contextmenu if a mouse is connected
const bindLongPressContext = useLongPress( const bindLongPressContext = useLongPress(