mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-23 09:06:23 +01:00
Filter links by type
This commit is contained in:
parent
72842c663a
commit
58d36d2403
1 changed files with 4 additions and 1 deletions
|
@ -64,7 +64,10 @@ function Trending({ columnMode, ...props }) {
|
||||||
|
|
||||||
// Get links
|
// Get links
|
||||||
try {
|
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);
|
console.log('links', links);
|
||||||
if (links?.length) {
|
if (links?.length) {
|
||||||
setLinks(links);
|
setLinks(links);
|
||||||
|
|
Loading…
Reference in a new issue