(event: MouseEvent)
| 66 | } |
| 67 | if (isOptedOut) { |
| 68 | const onClick = (event: MouseEvent) => { |
| 69 | const anchor = (event.target as Element | null)?.closest?.('a[href]'); |
| 70 | if (!(anchor instanceof HTMLAnchorElement) || !isOutsideLink(anchor)) { |
| 71 | return; |
| 72 | } |
| 73 | event.preventDefault(); |
| 74 | const postId = getRedirectPostId(anchor); |
| 75 | if (postId) { |
| 76 | viewPostRef.current?.(postId); |
| 77 | } |
| 78 | openInSystemBrowser(anchor.href); |
| 79 | }; |
| 80 | document.addEventListener('click', onClick, true); |
| 81 | return () => document.removeEventListener('click', onClick, true); |
| 82 | } |
nothing calls this directly
no test coverage detected