From 58d36d24033212d7e4f1fdeddd9a8f2a6a979e90 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Mon, 23 Oct 2023 08:55:22 +0800 Subject: [PATCH] Filter links by type --- src/pages/trending.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/trending.jsx b/src/pages/trending.jsx index 54040ea3..793a8a2c 100644 --- a/src/pages/trending.jsx +++ b/src/pages/trending.jsx @@ -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);