Don't include deleted or empty articles in list
This commit is contained in:
9
nostr.ts
9
nostr.ts
@@ -61,9 +61,12 @@ export async function fetchArticlesByAuthor(
|
||||
}]) as NostrEvent[];
|
||||
|
||||
const articles = events.map((a) => new Article(a));
|
||||
const sortedArticles = articles.sort((a, b) => b.publishedAt - a.publishedAt);
|
||||
// The limit seems to apply per relay, not per pool query
|
||||
return sortedArticles.slice(0, limit);
|
||||
|
||||
return articles
|
||||
.filter((a) => !a.isDeleted)
|
||||
.filter((a) => a.content.trim() !== "")
|
||||
.sort((a, b) => b.publishedAt - a.publishedAt)
|
||||
.slice(0, limit); // The limit seems to apply per relay, not per pool query
|
||||
}
|
||||
|
||||
export async function fetchProfileEvent(pubkey: string) {
|
||||
|
||||
Reference in New Issue
Block a user