this repo has no description
0
fork

Configure Feed

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

Fix Lemmy post links not working

Because it's self-referential

+12 -3
+6 -1
src/components/status.jsx
··· 1128 1128 lang={language} 1129 1129 dir="auto" 1130 1130 class="inner-content" 1131 - onClick={handleContentLinks({ mentions, instance, previewMode })} 1131 + onClick={handleContentLinks({ 1132 + mentions, 1133 + instance, 1134 + previewMode, 1135 + statusURL: url, 1136 + })} 1132 1137 dangerouslySetInnerHTML={{ 1133 1138 __html: enhanceContent(content, { 1134 1139 emojis,
+6 -2
src/utils/handle-content-links.js
··· 1 1 import states from './states'; 2 2 3 3 function handleContentLinks(opts) { 4 - const { mentions = [], instance, previewMode } = opts || {}; 4 + const { mentions = [], instance, previewMode, statusURL } = opts || {}; 5 5 return (e) => { 6 6 let { target } = e; 7 7 target = target.closest('a'); ··· 50 50 const hashURL = instance ? `#/${instance}/t/${tag}` : `#/t/${tag}`; 51 51 console.log({ hashURL }); 52 52 location.hash = hashURL; 53 - } else if (states.unfurledLinks[target.href]?.url) { 53 + } else if ( 54 + states.unfurledLinks[target.href]?.url && 55 + statusURL !== target.href 56 + ) { 57 + // If unfurled AND not self-referential 54 58 e.preventDefault(); 55 59 e.stopPropagation(); 56 60 states.prevLocation = {