(event: React.MouseEvent<HTMLAnchorElement>)
| 202 | const resolution = thread.resolutionId === message.id; |
| 203 | |
| 204 | function onLinkClick(event: React.MouseEvent<HTMLAnchorElement>) { |
| 205 | const url = event.currentTarget.href; |
| 206 | if (isArchiveUrl(url)) { |
| 207 | event.stopPropagation(); |
| 208 | event.preventDefault(); |
| 209 | fetch('/api/link', { |
| 210 | method: 'POST', |
| 211 | body: JSON.stringify({ |
| 212 | url, |
| 213 | }), |
| 214 | headers: { |
| 215 | 'Content-Type': 'application/json', |
| 216 | }, |
| 217 | }) |
| 218 | .then((response) => response.json()) |
| 219 | .then(({ incrementId }) => { |
| 220 | if (incrementId) { |
| 221 | window.location.href = getThreadUrl({ |
| 222 | isSubDomainRouting, |
| 223 | settings, |
| 224 | incrementId, |
| 225 | LINEN_URL: |
| 226 | process.env.NODE_ENV === 'development' |
| 227 | ? 'http://localhost:3000' |
| 228 | : 'https://www.linen.dev', |
| 229 | }); |
| 230 | } else { |
| 231 | window.location.href = url; |
| 232 | } |
| 233 | }); |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | const isAdminOrOwner = |
| 238 | message.author?.role === Roles.ADMIN || |
nothing calls this directly
no test coverage detected