From 4001e1c47a5ddb28c39754638108e16a705389cc Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 26 Apr 2023 10:35:26 +0800 Subject: [PATCH] Match logic for context menu and long press --- src/components/status.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/status.jsx b/src/components/status.jsx index 074db7a8..0ed25459 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -679,6 +679,8 @@ function Status({ }, ); + const showContextMenu = size !== 'l' && !previewMode && !_deleted; + return (
{ - if (size === 'l') return; + if (!showContextMenu) return; if (e.metaKey) return; - if (previewMode) return; - if (_deleted) return; // console.log('context menu', e); const link = e.target.closest('a'); if (link && /^https?:\/\//.test(link.getAttribute('href'))) return; @@ -708,9 +708,9 @@ function Status({ }); setIsContextMenuOpen(true); }} - {...bindLongPress()} + {...(showContextMenu ? bindLongPress() : {})} > - {size !== 'l' && ( + {showContextMenu && (