this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Disable context menu inside notifications popover

Popovers over popovers ain't easy

+25 -15
+24 -15
src/components/notification.jsx
··· 67 67 68 68 const AVATARS_LIMIT = 50; 69 69 70 - function Notification({ notification, instance, isStatic }) { 70 + function Notification({ 71 + notification, 72 + instance, 73 + isStatic, 74 + disableContextMenu, 75 + }) { 71 76 const { id, status, account, report, _accounts, _statuses } = notification; 72 77 let { type } = notification; 73 78 ··· 300 305 ? `/${instance}/s/${actualStatusID}` 301 306 : `/s/${actualStatusID}` 302 307 } 303 - onContextMenu={(e) => { 304 - const post = e.target.querySelector('.status'); 305 - if (post) { 306 - // Fire a custom event to open the context menu 307 - if (e.metaKey) return; 308 - e.preventDefault(); 309 - post.dispatchEvent( 310 - new MouseEvent('contextmenu', { 311 - clientX: e.clientX, 312 - clientY: e.clientY, 313 - }), 314 - ); 315 - } 316 - }} 308 + onContextMenu={ 309 + !disableContextMenu 310 + ? (e) => { 311 + const post = e.target.querySelector('.status'); 312 + if (post) { 313 + // Fire a custom event to open the context menu 314 + if (e.metaKey) return; 315 + e.preventDefault(); 316 + post.dispatchEvent( 317 + new MouseEvent('contextmenu', { 318 + clientX: e.clientX, 319 + clientY: e.clientY, 320 + }), 321 + ); 322 + } 323 + } 324 + : undefined 325 + } 317 326 > 318 327 {isStatic ? ( 319 328 <Status status={actualStatus} size="s" />
+1
src/pages/home.jsx
··· 179 179 key={notification.id} 180 180 instance={instance} 181 181 notification={notification} 182 + disableContextMenu 182 183 /> 183 184 ))} 184 185 </>