1
0
Fork 0

Filter links by type

This commit is contained in:
Lim Chee Aun 2023-10-23 08:55:22 +08:00
parent 72842c663a
commit 58d36d2403

View file

@ -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);