Remove placeholder content in feed
cgen-e181e9a2c78747e8b84853b040240bc1
This commit is contained in:
parent
88d4cd0bc9
commit
30704020b0
1 changed files with 2 additions and 25 deletions
|
|
@ -89,31 +89,8 @@ export default function Feed() {
|
||||||
comments: p.comments_count ?? 0,
|
comments: p.comments_count ?? 0,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
// If no posts yet, fall back to recommended people as placeholders
|
|
||||||
if (mapped.length === 0) {
|
setItems(mapped);
|
||||||
const recs = await aethexSocialService.listRecommended(
|
|
||||||
user?.id || "guest",
|
|
||||||
12,
|
|
||||||
);
|
|
||||||
const placeholders: FeedItem[] = recs.map((r: any) => ({
|
|
||||||
id: r.id,
|
|
||||||
authorId: r.id,
|
|
||||||
authorName: r.full_name || r.username || "User",
|
|
||||||
authorAvatar: r.avatar_url,
|
|
||||||
caption: r.bio || "",
|
|
||||||
mediaUrl: r.banner_url || r.avatar_url || null,
|
|
||||||
mediaType: r.banner_url?.match(/\.(mp4|webm|mov)(\?.*)?$/i)
|
|
||||||
? "video"
|
|
||||||
: r.banner_url || r.avatar_url
|
|
||||||
? "image"
|
|
||||||
: "none",
|
|
||||||
likes: Math.floor(Math.random() * 200) + 5,
|
|
||||||
comments: Math.floor(Math.random() * 30),
|
|
||||||
}));
|
|
||||||
setItems(placeholders);
|
|
||||||
} else {
|
|
||||||
setItems(mapped);
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue