uniq
This commit is contained in:
parent
ee09bae19f
commit
ece0b4b6ac
@ -6,19 +6,8 @@ import {
|
||||
SectionTitle,
|
||||
SectionContent,
|
||||
} from "@/containers/PageSection";
|
||||
import LiveBadge from "@/components/Badges/LiveBadge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { RiArrowRightLine } from "react-icons/ri";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import Image from "next/image";
|
||||
import { cn, formatNumber, getTwoLetters } from "@/lib/utils";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { AspectRatio } from "@/components/ui/aspect-ratio";
|
||||
import useEvents from "@/lib/hooks/useEvents";
|
||||
import { Event } from "nostr-tools";
|
||||
import KindLoading from "@/components/KindCard/loading";
|
||||
@ -34,11 +23,11 @@ export default function FeaturedLists() {
|
||||
filter: {
|
||||
kinds: [30001 as NDKKind],
|
||||
authors: NOTABLE_ACCOUNTS.map((a) => nip19.decode(a).data.toString()),
|
||||
limit: 50,
|
||||
limit: 60,
|
||||
},
|
||||
});
|
||||
|
||||
const processedEvents = events
|
||||
const processedEvents = uniqBy((e) => getTagValues("d", e.tags), events)
|
||||
.filter(
|
||||
(a) =>
|
||||
!!getTagValues("image", a.tags) ?? !!getTagValues("picture", a.tags),
|
||||
|
@ -5,8 +5,9 @@ import Link from "next/link";
|
||||
import Spinner from "@/components/spinner";
|
||||
import { Event } from "nostr-tools";
|
||||
import useEvents from "@/lib/hooks/useEvents";
|
||||
import NDK, { NDKEvent, type NDKFilter } from "@nostr-dev-kit/ndk";
|
||||
import ListCard from "@/components/ListCard";
|
||||
import { uniqBy } from "ramda";
|
||||
import { getTagValues } from "@/lib/nostr/utils";
|
||||
|
||||
type SubscriptionsProps = {
|
||||
pubkey: string;
|
||||
@ -41,7 +42,7 @@ export default function Subscriptions({
|
||||
if (link) {
|
||||
return (
|
||||
<>
|
||||
{events.map((e) => {
|
||||
{uniqBy((e) => !!getTagValues("d", e.tags), events).map((e) => {
|
||||
return (
|
||||
<Link href={`/list/${e.encode()}`}>
|
||||
<ListCard key={e.id} event={e} />;
|
||||
@ -53,7 +54,7 @@ export default function Subscriptions({
|
||||
}
|
||||
return (
|
||||
<>
|
||||
{events.map((e) => {
|
||||
{uniqBy((e) => !!getTagValues("d", e.tags), events).map((e) => {
|
||||
return <ListCard key={e.id} event={e} />;
|
||||
})}
|
||||
</>
|
||||
|
Loading…
x
Reference in New Issue
Block a user