this repo has no description
0
fork

Configure Feed

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

More logic to prevent recursive/wrong quote posts

+16 -8
+16 -8
src/utils/unfurl-link.jsx
··· 83 83 limit: 1, 84 84 }) 85 85 .then((results) => { 86 - if (results.statuses.length > 0) { 87 - const status = results.statuses[0]; 88 - return { 89 - status, 90 - instance, 91 - }; 92 - } else { 93 - throw new Error('No results'); 86 + const { statuses } = results; 87 + if (statuses.length > 0) { 88 + // Filter out statuses that has content that contains the URL, in-case-sensitive 89 + const theStatuses = statuses.filter( 90 + (status) => 91 + !status.content?.toLowerCase().includes(theURL.toLowerCase()), 92 + ); 93 + 94 + if (theStatuses.length === 1) { 95 + return { 96 + status: theStatuses[0], 97 + instance, 98 + }; 99 + } 100 + // If there are multiple statuses, give up, something is wrong 94 101 } 102 + throw new Error('No results'); 95 103 }); 96 104 97 105 function handleFulfill(result) {