diff --git a/src/components/notification.jsx b/src/components/notification.jsx index 823d9f4..a4120ac 100644 --- a/src/components/notification.jsx +++ b/src/components/notification.jsx @@ -67,7 +67,12 @@ const contentText = { const AVATARS_LIMIT = 50; -function Notification({ notification, instance, isStatic }) { +function Notification({ + notification, + instance, + isStatic, + disableContextMenu, +}) { const { id, status, account, report, _accounts, _statuses } = notification; let { type } = notification; @@ -300,20 +305,24 @@ function Notification({ notification, instance, isStatic }) { ? `/${instance}/s/${actualStatusID}` : `/s/${actualStatusID}` } - onContextMenu={(e) => { - const post = e.target.querySelector('.status'); - if (post) { - // Fire a custom event to open the context menu - if (e.metaKey) return; - e.preventDefault(); - post.dispatchEvent( - new MouseEvent('contextmenu', { - clientX: e.clientX, - clientY: e.clientY, - }), - ); - } - }} + onContextMenu={ + !disableContextMenu + ? (e) => { + const post = e.target.querySelector('.status'); + if (post) { + // Fire a custom event to open the context menu + if (e.metaKey) return; + e.preventDefault(); + post.dispatchEvent( + new MouseEvent('contextmenu', { + clientX: e.clientX, + clientY: e.clientY, + }), + ); + } + } + : undefined + } > {isStatic ? ( diff --git a/src/pages/home.jsx b/src/pages/home.jsx index fe4503c..621500a 100644 --- a/src/pages/home.jsx +++ b/src/pages/home.jsx @@ -179,6 +179,7 @@ function NotificationsMenu({ anchorRef, state, onClose }) { key={notification.id} instance={instance} notification={notification} + disableContextMenu /> ))}