fix: remove reposts from grid

closes #722
This commit is contained in:
kieran 2024-04-12 11:33:04 +01:00
parent 81827dec96
commit e98b7fa17e
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941

View File

@ -1,4 +1,4 @@
import { NostrLink, TaggedNostrEvent } from "@snort/system";
import { EventKind, NostrLink, TaggedNostrEvent } from "@snort/system";
import { memo, MouseEvent, ReactNode } from "react";
import { useInView } from "react-intersection-observer";
import { Link } from "react-router-dom";
@ -17,8 +17,10 @@ const ImageGridItem = memo((props: ImageGridItemProps) => {
const { event, onClick, waitUntilInView } = props;
const { ref, inView } = useInView({ triggerOnce: true, rootMargin: "0px 0px 3000px 0px" });
const media = getEventMedia(event);
// skip reposts in image grid
if(event.kind === EventKind.Repost) return null;
const media = getEventMedia(event);
if (media.length === 0) return null;
const multiple = media.length > 1;