Skip to content

Commit

Permalink
Filter links by type
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Oct 23, 2023
1 parent 72842c6 commit 58d36d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/trending.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ function Trending({ columnMode, ...props }) {

// Get links
try {
const { value: links } = await fetchLinks(masto);
const { value } = await fetchLinks(masto);
// 4 types available: link, photo, video, rich
// Only want links for now
const links = value?.filter?.((link) => link.type === 'link');
console.log('links', links);
if (links?.length) {
setLinks(links);
Expand Down

0 comments on commit 58d36d2

Please sign in to comment.